Quickstart
Get SaaS Tracker running and send your first event in under 5 minutes.
This guide covers the hosted version. For self-hosting via Docker Compose, see the self-hosting guide.
1. Create an account
Go to app.saas-tracker.com and sign up. A workspace and API key are created automatically.
2. Install the SDK
npm install @saas-tracker/sdk3. Initialise the tracker
Call new SaaSTracker() once at app startup — before rendering or routing.
import { SaaSTracker } from "@saas-tracker/sdk";
export const tracker = new SaaSTracker({
apiKey: process.env.SAAS_TRACKER_API_KEY, // from your workspace settings
apiUrl: process.env.NEXT_PUBLIC_API_URL, // e.g. https://api.saas-tracker.com
});Never expose your API key on the client side. Use NEXT_PUBLIC_API_URL for the ingest endpoint URL only.
4. Identify users
Call identify as soon as you know who the user is (after login, on session restore):
tracker.identify("user-123", {
email: "user@example.com",
plan: "growth",
company: "Acme Corp",
createdAt: "2025-01-15T10:00:00Z",
});5. Track events
// Page views
tracker.track("page_view", { url: window.location.href, title: document.title });
// Feature usage
tracker.track("feature_used", { feature: "ai_chart", query_type: "funnel" });
// Conversion events
tracker.track("upgrade_clicked", { from_plan: "free", to_plan: "growth" });6. Verify in the dashboard
Go to Trends in your dashboard. You should see events appearing within 30 seconds.
If no events appear after 2 minutes:
- Check the browser network tab for
POST /ingestrequests - Verify your API key is correct in Settings
- Use Settings → Developer tools → Send test event to confirm the API is reachable
Self-hosting
SaaS Tracker ships as a Docker Compose stack.
Clone the repository
git clone https://github.com/saas-tracker/saas-tracker.git
cd saas-trackerCopy and fill environment variables
cp infra/secrets/prod.yaml.template infra/secrets/.env.prod
# Edit infra/secrets/.env.prod with your valuesStart services
docker compose -f infra/docker-compose.prod.yml up -dRun migrations
docker compose exec api bunx prisma migrate deployAccess the dashboard
The dashboard is available at https://app.yourdomain.com after Caddy issues a TLS certificate.