Sources & SDKs
Server SDK setup
Overview
Server SDKs are ideal for payments, refunds, and CRM changes that should never rely on browser availability. They sign requests with API keys, attach richer payloads, and support idempotent retries at the edge.
Steps
- Create a server-scoped key with rotation reminders enabled.
- Install the Node, Go, or Python package from the developer docs mirror.
- Instantiate a client pointed at the correct regional base URL.
import { TrackLayer } from "@tracklayer/node";
const client = new TrackLayer({ apiKey: process.env.TRACKLAYER_SERVER_KEY!, region: "eu" });
await client.track({
event: "SubscriptionRenewed",
userId: "usr_991",
properties: { mrr: 120, plan: "pro" },
idempotencyKey: "sub_renew_20260505_991",
});- Log
request_idfrom responses for support correlation.
Troubleshooting
- Region mismatch (401/403): regenerate the key in the same region you target.
- Clock skew beyond five minutes breaks signature helpers—sync NTP on workers.
- If batches fail halfway, split by logical partition; the API returns per-item errors inside the batch envelope.