SDK sample

Code blocks, Shiki highlighting, copy button, and package-manager tabs.

This page exercises fenced code blocks, Shiki syntax highlighting, the copy control, and tabbed install commands.

Install

npm install @leadara/sdk

TypeScript setup

import { Leadara } from "@leadara/sdk";

const client = new Leadara({
  apiKey: process.env.LEADARA_API_KEY!,
  endpoint: "https://api.leadara.com",
});

export async function trackSignup(userId: string, email: string) {
  await client.track({
    event: "signup",
    userId,
    properties: {
      email,
      source: "docs-sample",
      timestamp: new Date().toISOString(),
    },
  });
}

Sample JSON response

{
  "ok": true,
  "eventId": "evt_01HV3M2B4YF9Z",
  "profile": {
    "id": "usr_42",
    "email": "you@example.com",
    "segments": ["new-users", "en-locale"]
  }
}