Telemetry

Unkey collects anonymous telemetry data to help us understand usage of the framework. If you’re authoring an SDK, you should record usage information and send it via Upstash-Telemetry headers.

Typescript libraries

The Unkey Typescript library @unkey/api is already set up to collect telemetry data. If you’re writing a new SDK for a framework that makes use of that library under the hood, you just need to enable the user to disable telemetry; otherwise, pass it in the constructor. You can see an example of this via the Next.js SDK here.

Telemetry request headers

Unkey records telemetry data via three headers. You can see an example of how this is used in the Typescript SDK here

Unkey-Telemetry-SDK
string

Comma-separated list of strings recording SDKs. Can be multiple SDKs; for instance, the Next.js SDK will record both the Next.js SDK version and Typescript SDK version.

Unkey-Telemetry-Platform
string

Referring to the platform where the calling application is deployed.

For example: Vercel, Cloudflare, AWS, Deno

Unkey-Telemetry-Runtime
string

Referring to the programming runtime.

For example: edge-light, node@18, node@20.0.1

Sending Telemetry
curl -XPOST 'https://api.unkey.dev/v1/keys.verifyKey' \
  -H "Content-Type: application/json" \
  -H "Unkey-Telemetry-SDK: @unkey/api@1.10.0" \
  -H "Unkey-Telemetry-Platform: Vercel" \
  -H "Unkey-Telemetry-Runtime: edge-light" \
  -d '{ "key": "<...>" }'

Was this page helpful?