Back to Docs

Quick Start Guide

Get analytics working in your app in under 5 minutes.

1Get Your API Key

Go to Settings → API Keys and click "Generate New Key".

  • Give it a name (e.g., "Production", "Staging")
  • Select Write type for sending events
  • Copy the key - you'll only see it once!

2Send Events to the Collector

POST a batch to /v1/capture with your write key:

await fetch("https://analytics.example.com/v1/capture", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Write-Key": "YOUR_WRITE_KEY_HERE",
  },
  body: JSON.stringify({
    batch: [{
      event_id: crypto.randomUUID(),
      event_name: "page_view",
      event_type: "page",
      timestamp: new Date().toISOString(),
      anonymous_id: crypto.randomUUID(),
      session_id: crypto.randomUUID(),
      context: { page: { url: location.href, title: document.title } },
    }],
    sent_at: new Date().toISOString(),
  }),
});

3Optional: Lite SDK helpers

For service-journey beacons and handshake tokens:

import { completeServiceJourney } from "@analytics/sdk";

// journey_id must be present in the page URL query string (?journey_id=...)
completeServiceJourney({
  endpointBase: "https://dashboard.example.com/api/dashboard",
});

4View in Dashboard

Events appear in your dashboard almost instantly. Go to:

Next Steps