Sazabi
API Keys

Public Keys

Project-scoped API keys for sending logs and telemetry to Sazabi.

Public keys authenticate log ingestion requests. They are project-scoped and designed to be safely included in client-side code.

Overview

Public keys are used for sending logs and telemetry to Sazabi. They are:

  • Project-scoped: Each public key is tied to a specific project.
  • Write-only: They can only ingest data, not read it.
  • Safe to expose: While you should not share them unnecessarily, public keys cannot be used to access your data.

Public keys have the prefix sazabi_public_ followed by a unique identifier.

Creating public keys

Go to API Keys settings

Navigate to Settings in the left sidebar, then click API Keys.

Select Public Keys

Click the Public Keys tab.

Create key

Click Create key.

Name the key

Enter a descriptive name for the key (e.g., "production-logs", "vercel-adapter").

Select project

Choose the project this key will send logs to.

Copy the key

Copy the key immediately. It is only shown once and cannot be retrieved later.

Copy your key immediately after creation. For security reasons, the full key is only displayed once. If you lose it, you must create a new key.

Using public keys

Public keys are used when configuring log ingestion. Pass the key in the x-api-key header or configure it in your SDK.

HTTP header

curl -X POST https://intake.sazabi.com/v1/logs \
  -H "Content-Type: application/json" \
  -H "x-api-key: sazabi_public_abc123def456" \
  -d '{"message": "Hello, Sazabi!"}'

Environment variable

export SAZABI_PUBLIC_KEY=sazabi_public_abc123def456

SDK configuration

Most Sazabi SDKs and integrations accept the public key as a configuration option:

import { Sazabi } from "@sazabi/sdk";

const sazabi = new Sazabi({
  publicKey: "sazabi_public_abc123def456",
});

Revoking public keys

To revoke a public key:

Go to API Keys settings

Navigate to Settings in the left sidebar, then click API Keys.

Find the key

Locate the key you want to revoke in the Public Keys tab.

Revoke

Click the menu icon (...) next to the key and select Revoke.

Confirm

Confirm the revocation. This action takes effect immediately and cannot be undone.

Revocation is immediate. Any applications using the revoked key will stop sending logs instantly. Make sure you have updated all applications before revoking a key.

Best practices

  • One key per data source: Create separate keys for different applications or environments to track usage and revoke access independently.
  • Use descriptive names: Name keys after their purpose (e.g., "production-api", "staging-frontend") to easily identify them later.
  • Rotate regularly: Even though public keys are write-only, rotate them periodically as a security best practice.

Next steps