Skip to main content

Quick Start Guide

This guide walks you through the essential steps to start sending emails with Sequenzy.

Prerequisites

  • A Sequenzy account (sign up here)
  • A verified sending domain (configured in Settings → Domains)
  • An API key (generated in Settings → API Keys)

Step 1: Get Your API Key

  1. Log in to your Sequenzy dashboard
  2. Navigate to Settings → API Keys
  3. Click Create API Key
  4. Copy and securely store your key—it won’t be shown again
Keep your API key secret. Never expose it in client-side code or public repositories.

Step 2: Install the SDK

Install the official Sequenzy SDK for Node.js/TypeScript:
npm install sequenzy
Then initialize the client:
import Sequenzy from "sequenzy";

const client = new Sequenzy({
  apiKey: process.env.SEQUENZY_API_KEY,
});

Step 3: Add Your First Subscriber

await client.subscribers.create({
  email: "john@example.com",
  firstName: "John",
  lastName: "Doe",
  tags: ["new-signup"],
  customAttributes: {
    plan: "free",
    source: "website",
  },
});

Step 4: Tag Subscribers Based on Actions

When users take actions in your app, tag them to trigger automations:
await client.subscribers.tags.add({
  email: "john@example.com",
  tag: "customer",
});

Step 5: Track Events

Send events when important things happen:
await client.subscribers.events.trigger({
  email: "john@example.com",
  event: "purchase_completed",
  properties: {
    orderId: "order_12345",
    amount: 99.99,
    product: "Pro Plan",
  },
});

Step 6: Send a Transactional Email

Send an immediate email using a template or direct content:

Using a Template

await client.transactional.send({
  to: "john@example.com",
  slug: "welcome-email",
  variables: {
    firstName: "John",
    dashboardUrl: "https://app.example.com/dashboard",
  },
});

Direct Content

await client.transactional.send({
  to: "john@example.com",
  subject: "Welcome to Our Platform!",
  body: "<h1>Welcome, {{firstName}}!</h1><p>Thanks for signing up.</p>",
  variables: {
    firstName: "John",
  },
});

What’s Next?

Common Integration Patterns

User Registration

import Sequenzy from "sequenzy";

const client = new Sequenzy({ apiKey: process.env.SEQUENZY_API_KEY });

// When a user signs up
await client.subscribers.create({
  email: user.email,
  firstName: user.firstName,
  lastName: user.lastName,
  tags: ["new-signup"],
  customAttributes: {
    userId: user.id,
    plan: "free",
    signupDate: new Date().toISOString(),
  },
});

Subscription Upgrade

// When a user upgrades
await client.subscribers.events.trigger({
  email: user.email,
  event: "saas.purchase",
  properties: {
    plan: "pro",
    amount: 29.99,
    currency: "USD",
  },
});

Order Confirmation

// Send order confirmation email
await client.transactional.send({
  to: customer.email,
  slug: "order-confirmation",
  variables: {
    orderNumber: order.id,
    total: order.total,
    items: order.items.map((i) => i.name).join(", "),
  },
});