Docs

Quickstart

Send your first audit log event in under 5 minutes.

Just want to try it?

Skip signup entirely with Stream Mode. Install the SDK, call LogStitch.stream(), and start sending events immediately — no account or API key needed. Claim your stream later when you're ready to sign up.

1. Sign Up#

Go to logstitch.io and create an account. You can sign in with a magic link or Google OAuth. No credit card required.

2. Create a Project#

From the dashboard, create a new project. A project represents a product or app that will send audit log events to LogStitch.

3. Get Your API Key#

Navigate to your project's API Keys page and copy your project key. It starts with pk_.

Keep your keys safe

Project keys authenticate event ingestion and queries. Never expose them in client-side code. Use them server-side only.

4. Install the SDK#

npm install @logstitch/sdk

5. Send Your First Event#

Initialize the client with your project key and call log() to send an event.

index.ts
import { LogStitch } from '@logstitch/sdk';

const logstitch = new LogStitch({
  projectKey: 'pk_your_key_here',
});

await logstitch.log({
  action: 'user.signed_up',
  category: 'auth',
  actor: { id: 'user_123', type: 'user', name: 'Alice' },
  tenant_id: 'acme_corp',
});

// Flush before process exit
await logstitch.close();

Batching

The SDK batches events automatically. Call close() before your process exits to flush any remaining events.

6. Query Events#

Verify your event was ingested by querying the API directly.

Query events via cURL
curl https://logstitch.io/api/v1/events \
  -H "Authorization: Bearer pk_your_key_here" \
  -G -d "tenant_id=acme_corp"

You should see your event in the response. Events are returned in reverse chronological order with cursor-based pagination.

Next Steps#

  • SDK Reference — Batching, retry logic, fire-and-forget mode, and more.
  • API Reference — Full REST API documentation for events, keys, and configuration.
  • PII Redaction — Configure built-in patterns and custom rules to protect sensitive data.