Getting StartedQuick Start
Getting Started

Quick Start

Get up and running with Flameup in 5 minutes

Quick Start Guide

This guide will walk you through integrating Flameup into your application. By the end, you'll be able to identify users, track events, and send your first message.

Prerequisites: You'll need a Flameup account and an API key. Sign up at app.flameup.ai if you haven't already.

Step 1: Get Your API Key

Log into Dashboard

Go to app.flameup.ai and log in to your account.

Navigate to API Keys

Go to Settings > API Keys in the sidebar.

Create a New Key

Click Create API Key, give it a name like "My App - Development", select Test environment, and grant the following permissions:

  • people:read
  • people:write
  • events:read
  • events:write

Copy Your Key

Copy the API key and save it securely. It follows the format ws_test_{workspace}_{random}.{secret}

Step 2: Identify a User

When a user signs up or logs in, identify them to Flameup. This creates or updates their profile.

const API_KEY = 'ws_test_abc12345_abc123.your_secret_here';
const WORKSPACE_ID = 'your_workspace_id';

async function identifyUser(userId, email, traits) {
  const response = await fetch(
    `https://api.flameup.ai/api/v1/workspaces/${WORKSPACE_ID}/people`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${API_KEY}`
      },
      body: JSON.stringify({
        userId: userId,
        email: email,
        traits: traits
      })
    }
  );

  return response.json();
}

// Example usage
const user = await identifyUser(
  'user_12345',
  'sarah@example.com',
  {
    first_name: 'Sarah',
    last_name: 'Connor',
    plan: 'premium',
    signup_date: '2024-01-15'
  }
);

console.log('User identified:', user.id);
The userId is your unique identifier for this user. It can be a database ID, username, or any stable identifier in your system.

Step 3: Track an Event

Track user actions to understand behavior and trigger campaigns.

async function trackEvent(externalId, eventName, parameters) {
  const response = await fetch(
    'https://api.flameup.ai/api/v1/track',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${API_KEY}`
      },
      body: JSON.stringify({
        external_id: externalId,
        event: eventName,
        parameters: parameters,
        timestamp: new Date().toISOString()
      })
    }
  );

  return response.json();
}

// Track a purchase
await trackEvent('user_12345', 'purchase_completed', {
  order_id: 'order_789',
  amount: 99.99,
  currency: 'USD',
  items: ['product_a', 'product_b']
});

console.log('Event tracked!');

Step 4: Register a Device (Optional)

If your app uses push notifications, register the device token:

async function registerDevice(personId, token, platform) {
  const response = await fetch(
    `https://api.flameup.ai/api/v1/people/${personId}/devices`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${API_KEY}`
      },
      body: JSON.stringify({
        token: token,
        platform: platform, // 'ios' or 'android' ('web' coming soon)
        device_name: 'iPhone 15 Pro',
        app_version: '2.1.0'
      })
    }
  );

  return response.json();
}

// Register an iOS device (personId is the Flameup person ID from Step 2)
await registerDevice(
  'person_abc123',
  'fcm_device_token_here',
  'ios'
);

Step 5: Send a Transactional Message

Send a one-off message to a user (e.g., order confirmation):

async function sendTransactional(userId, templateId, channel, variables) {
  const response = await fetch(
    `https://api.flameup.ai/api/v1/workspaces/${WORKSPACE_ID}/transactional/send`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${API_KEY}`
      },
      body: JSON.stringify({
        user_id: userId,
        template_id: templateId,
        channel: channel,  // 'email', 'sms', or 'push'
        variables: variables
      })
    }
  );

  return response.json();
}

// Send order confirmation via push
await sendTransactional('user_12345', 'order_confirmation', 'push', {
  order_id: 'order_789',
  total: '$99.99',
  items: '2 items'
});

Verification

Check that everything is working:

  1. Dashboard: Log into app.flameup.ai and check the People section - you should see your test user.

  2. API: Fetch the user you just created:

curl "https://api.flameup.ai/api/v1/workspaces/{workspace_id}/people/search?email=sarah@example.com" \
  -H "Authorization: Bearer ws_test_abc12345_abc123.your_secret_here"

What's Next?

When you're ready for production, create a Live API key and update your integration. Test and live environments are completely separate.
Was this page helpful?
Built with Documentation.AI

Last updated today