SDK installation guide

Install FirstDistro SDK in HTML, Next.js, or React. Token-based installation provides zero configuration and automatic initialization.

Last Updated: November 25, 2025
SDK Version: 2.0.0 (Static API)

Installation

FirstDistro SDK uses token-based installation for zero configuration and automatic initialization.

Get your installation token: Dashboard → Settings → SDK Configuration

Choose your framework

Quick Installation (Token-based)

Add this script tag before the closing </body> tag:

⚠️ Important: Replace fd_your-token-here with your actual installation token from the dashboard. Your token will look like: fd_hnrpps0i93yyfgdldhylhelieerup68s

<script src="https://firstdistro.com/sdk/install/fd_your-token-here.js"></script>

Installation complete!

Next steps:

  1. The SDK is now loaded and ready to use
  2. Use FirstDistro.setup() to set user and account context
  3. See usage example below for complete code
Show usage example

Use setup() to set user and account context in one call. Account grouping is required for Customer Insights to work.

After adding the script tag, the SDK is automatically initialized. Use it anywhere in your HTML:

<script>
// SDK is automatically initialized!

// Set user and account context in one call
FirstDistro.setup({
  user: { id: 'user-123', name: 'John Doe', email: 'john@example.com' },
  account: { id: 'account-456', name: 'Acme Corp', plan: 'enterprise' }
});

// Track events
FirstDistro.track('page_viewed', {
  page: window.location.pathname
});
</script>

Verification

After installation, check the browser console for:

  • [FirstDistro] ✅ SDK initialized
  • [FirstDistro] ✅ Enabling event tracking (if tracking enabled)

Next steps