Skip to content

Quickstart

This guide shows how to send your first analytics event directly to the devgrowthlab API.
There’s no SDK or tracking script - just one simple HTTPS POST request.

Each day the user opens your app or website, send an event to the devgrowthlab service. You don’t need to send more than one event a day.

In your dashboard, go to Settings → Integration and copy your JWT token (it should start with ey...). You’ll use this in the Authorization header as Bearer YOUR_TOKEN.

The ingestion page of the dashboard

The endpoint is:

POST https://api.devgrowthlab.com/ingest

Request body:

{
"lastToken": "string or null",
"cohorts": {
"Example Cohort": "Example Value"
}
}
  • lastToken: pass the token returned by the previous request, or null if it’s the user’s first session.
  • cohorts: a simple map of strings to strings - you can use it to group users by plan, referrer, or experiment.
    We’ll cover advanced cohorting later in the Guides section.

Response:

{
"token": "string"
}

You must store this new token securely and include it as lastToken in the next request. This token isn’t an identifier and doesn’t identify the user, its a compact representation of the last data sent so the devgrowthlab service doesn’t duplicate records, or count the user as a fresh install on every app open.

Choose your preferred framework below and copy the example into your project.

const response = await fetch("https://api.devgrowthlab.com/ingest", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_JWT_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
lastToken: localStorage.getItem("devgrowthlab_token") || null,
cohorts: {
// See the guide on cohorts for more info
"Example Cohort": "Example Value"
}
})
});
const data = await response.json();
if (data.token) {
// ⚠️ Store the new token securely
// Note: In GDPR regions, only store persistent data after user consent.
localStorage.setItem("devgrowthlab_token", data.token);
}

Go back to your dashboard, under Settings → Integration last ingestion should now list the current date. It may take a few moments to process.

If you have an existing app with a large cohort of existing users then it’s recommended to send additional information to the service at first so the devgrowthlab can accurately model the retention curve for your app. Follow the guide here.