Eventlayer / Start building

API Keys

Create and manage API keys for authentication.

API keys authenticate your requests and associate them with your account. Each key has a unique public identifier and a secret token used for authentication.

Creating an API key

Create keys from API Keys in the dashboard. Select New key and use a name that identifies both the application and environment, such as checkout-production.

API Keys management page in the Eventlayer dashboard
Use a separate, clearly named key for each application and environment.

The token is only shown once at creation time. Store it securely — you will not be able to retrieve it later.

Store the token in a server-side secret manager or environment variable. Do not embed it in browser JavaScript or a distributed mobile application.

Programmatic key management

Once your application is authenticated, keys can also be listed, renamed, and revoked through the SDK. This is useful for internal provisioning and rotation workflows; the dashboard remains the recommended path for day-to-day management.

Listing API keys

const { data: keys, error } = await eventlayer.apiKeys.list();
if (error) throw error;

Updating an API key

await eventlayer.apiKeys.update({
  apiKeyId: "sk_35d400aab1a52a2f",
  name: "Production Application",
});

Deleting an API key

Deleting an API key immediately revokes access. Any applications using this key will begin receiving 401 Unauthorized responses.

await eventlayer.apiKeys.delete({ apiKeyId: "sk_35d400aab1a52a2f" });

Next steps

After creating a key, the dashboard offers separate copy buttons for the raw key and EVENTLAYER_KEY=…. The TypeScript SDK reads EVENTLAYER_KEY automatically when initialized with new Eventlayer(). Store it only in your server environment.