Passa al contenuto principale
Versione: Next

Guida introduttiva

Prerequisiti

Un account Northwind Cloud e una chiave API Atlas (Impostazioni → Chiavi API). Usa chiavi separate per staging e produzione.

Invia il tuo primo evento

cURL

curl https://api.northwind.cloud/v1/atlas/events \
-H "Authorization: Bearer $ATLAS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"events": [{
"name": "checkout_completed",
"user_id": "usr_8f3a1c",
"timestamp": "2026-07-15T14:32:00Z",
"properties": { "revenue": 84.50, "currency": "USD", "items": 3 }
}]
}'

Node.js

import { Atlas } from "@northwind/atlas";

const atlas = new Atlas({ apiKey: process.env.ATLAS_API_KEY });

await atlas.track({
name: "checkout_completed",
userId: "usr_8f3a1c",
properties: { revenue: 84.50, currency: "USD", items: 3 },
});

Python

from northwind_atlas import Atlas

atlas = Atlas(api_key=os.environ["ATLAS_API_KEY"])

atlas.track(
name="checkout_completed",
user_id="usr_8f3a1c",
properties={"revenue": 84.50, "currency": "USD", "items": 3},
)

Tutti e tre fanno la stessa cosa: sono wrapper sottili su POST /v1/atlas/events (riferimento API).

Identificare gli utenti

Se un visitatore anonimo poi accede, non reinviare lo storico con il nuovo user_id — usa l'endpoint di fusione identità:

curl https://api.northwind.cloud/v1/atlas/identities/merge \
-H "Authorization: Bearer $ATLAS_API_KEY" \
-d '{ "anonymous_id": "anon_x92k1", "user_id": "usr_8f3a1c" }'

Verifica che abbia funzionato

curl "https://api.northwind.cloud/v1/atlas/events?user_id=usr_8f3a1c&limit=1" \
-H "Authorization: Bearer $ATLAS_API_KEY"

Array data vuoto? Controlla prima l'ambiente della chiave prima di presumere un fallimento dell'ingestione.