Article

Best Audit Log APIs for Node.js B2B SaaS Apps in 2026

Compare WorkOS, Pangea Secure Audit Log, Retraced, and self-hosted audit logging for Node.js B2B SaaS: pricing, retention, SIEM export, and architecture.

Best Audit Log APIs for Node.js B2B SaaS Apps in 2026

Audit logs often start as a line item on an enterprise security questionnaire. Then a customer has an incident. That is when the feature stops being a checkbox and becomes infrastructure.

For a Node.js SaaS company selling into larger organizations, an audit log must answer a simple set of questions quickly and reliably: who performed the action, what they did, which resource changed, which tenant the event belonged to, when it happened, where the request came from, whether the customer can search or export it, whether it can be streamed into a SIEM, and whether the history can be trusted.

Those requirements are materially different from ordinary application logging. Application logs are optimized for engineers debugging services. Audit logs are designed to create a durable, customer-facing record of security-relevant and business-critical actions. That difference affects schema design, retention, storage integrity, multi-tenant isolation, UI, export formats, and pricing.

This guide compares four practical approaches for Node.js B2B SaaS in 2026: WorkOS Audit Logs, Pangea Secure Audit Log under CrowdStrike, Retraced as an open-source/self-hosted option, and building the stack yourself.

Quick Recommendation

For most B2B SaaS teams moving upmarket, WorkOS is the strongest default when you want customer-facing audit logs, structured schemas, Admin Portal access, and straightforward SIEM streaming without building the product layer yourself.

Pangea Secure Audit Log is the stronger fit when cryptographic integrity, tamperproof verification, long retention tiers, redaction, and security-oriented evidence are more important than the most polished SaaS administration workflow.

Retraced remains useful as an open-source building block when self-hosting is important, but it should be evaluated as infrastructure you operate rather than as the obvious new managed SaaS purchase. BoxyHQ was acquired by Ory, and the current BoxyHQ signup page says new signups are no longer accepted.

Building your own audit-log platform can make sense for unusual data-residency, air-gapped, regulatory, or product requirements, but it is significantly more work than writing events to a database table.

Audit Logs vs Application Logs

One of the most common architectural mistakes is treating an audit log as a second copy of the application log.

A typical Node.js application log might say:

2026-08-27T01:24:13Z POST /api/projects/823 200 47ms

That is useful for operations. A useful audit event needs business context:

{
  "tenant_id": "org_42",
  "action": "project.member_role_changed",
  "actor": {
    "type": "user",
    "id": "usr_17",
    "email": "[email protected]"
  },
  "target": {
    "type": "project_member",
    "id": "member_823"
  },
  "occurred_at": "2026-08-27T01:24:13.000Z",
  "context": {
    "ip": "203.0.113.8",
    "user_agent": "Mozilla/5.0"
  },
  "metadata": {
    "old_role": "member",
    "new_role": "admin"
  }
}

That event can be reviewed by the customer, searched by actor or target, exported during an investigation, and streamed into a SIEM. The schema itself becomes part of the product contract.

Comparison Table

OptionBest ForNode.js SupportCustomer-Facing UISIEM / ExportTamper EvidenceRetention Model
WorkOS Audit LogsB2B SaaS enterprise readinessNative Node.js SDKStrong; Admin Portal + private accessStrong; SIEM, object storage, HTTP destinations, CSVPlatform-managedPer-organization configurable retention
Pangea Secure Audit LogSecurity/compliance-heavy SaaSNative Node.js SDKSecure Audit Log ViewerSearch, export, SIEM forwardingVery strong; Merkle-tree verificationHot/Warm/Cold tiers, up to 10 years
RetracedOpen-source/self-hosted SaaSOfficial Node.js clientEmbeddable viewerSearch/exportDepends on deploymentSelf-managed
Build YourselfHighly custom or regulated environmentsFull controlYou build itYou build itYou build itYou build it

1. WorkOS Audit Logs

WorkOS is the easiest option to recommend to a typical B2B SaaS company because it treats audit logging as an enterprise product feature rather than only a storage API.

Its current Audit Logs product supports Node.js and other SDKs, organization-scoped audit events, actor/action/target/context structures, custom metadata schemas, schema validation, CSV export, customer access through the Admin Portal, log streaming to external destinations, configurable retention, and idempotent event creation.

The current WorkOS rate-limit documentation lists 6,000 Audit Log create-event requests per 60 seconds per API key.

Why WorkOS Fits B2B SaaS

The important advantage is not merely ingestion. It is the customer-facing workflow around the data.

Enterprise customers increasingly want audit events in tools they already use. WorkOS supports log streams to destinations such as Splunk, Datadog, Snowflake, S3, Google Cloud Storage, and a generic HTTP endpoint. That means a Node.js SaaS company does not have to build a separate integration pipeline for every customer security team.

The WorkOS Admin Portal can also let customers configure enterprise capabilities without creating a support ticket for every change. For SaaS teams selling higher-value plans, that administrative experience matters.

WorkOS Pricing in August 2026

The current WorkOS pricing page lists Audit Logs with a $0 monthly base.

The two published usage items are:

  • Log streaming: $125 per SIEM connection per month
  • Event retention: $99 per million events stored per month

This pricing model is easy to understand but has an important implication. If many enterprise customers want their own SIEM connection, connection pricing may matter more than raw event volume for some SaaS businesses.

When designing your packaging, decide whether SIEM streaming is included in an Enterprise plan, sold as an add-on, limited to one destination, or bundled with longer retention. Audit-log cost is not only a backend infrastructure bill; it is also a packaging decision.

WorkOS Retention

A WorkOS article published on August 4, 2026 states that audit logs are retained for 30 days by default and that an organization’s retention period can be extended to 365 days through the API.

That makes retention a usable plan-level capability. For example, Standard could offer 30 days, Business 90 days, Enterprise 365 days, and Enterprise Plus 365 days plus SIEM streaming.

Best Use Case for WorkOS

Choose WorkOS when you sell B2B SaaS to enterprise customers, already use or may use WorkOS for SSO/Directory Sync, need a polished audit-log experience, want SIEM streaming without building connectors, prefer transparent list pricing, and want to buy the product layer rather than operate it.

2. Pangea Secure Audit Log, Now Under CrowdStrike

Pangea is a different kind of option. Its Secure Audit Log is designed around tamperproof storage and cryptographic verification.

CrowdStrike announced its intent to acquire Pangea in September 2025, and CrowdStrike filings state that the acquisition closed on September 26, 2025. The Pangea documentation remains active in 2026 and is now presented with CrowdStrike branding.

For buyers, that ownership change matters because the product should be evaluated as part of the current CrowdStrike/Pangea direction rather than as a standalone startup with the same commercial assumptions it had several years ago.

Tamperproofing

Pangea uses Merkle Trees to verify the integrity of audit-log history. Its documentation describes verification for both individual events and the consistency of the overall log.

Current documentation says a new root hash is published after one hour or 10,000 events, whichever comes first, to an immutable public ledger on Arweave.

The goal is to provide evidence that an event was not modified after ingestion, historical events were not silently deleted, and new events were not inserted into old history without detection.

For a SaaS product serving security-sensitive or regulated customers, that is materially stronger than “we have a table with restricted UPDATE permissions.”

Retention Tiers

Current Pangea documentation describes three storage tiers:

  • Hot: optimized for search, retained for up to 14 days
  • Warm: searchable/exportable, retained for up to 10 years
  • Cold: archive-oriented, retained for up to 10 years

This is useful for customers with long evidence-retention requirements and creates a clear separation between interactive search and long-term recovery.

Node.js Integration

Pangea maintains a Node.js SDK for Secure Audit Log. Its event model includes fields such as actor, action, status, source, target, message, old, new, and tenant_id. It also exposes search, export, download, and verification capabilities.

The current v2 bulk endpoint accepts batches of up to 1,000 events.

Pricing Consideration

Unlike WorkOS, the public documentation retrieved for this review does not expose a stable, simple unit-price table for Secure Audit Log. The docs do state that Secure Audit Log usage consumes credits and can incur cost, and export requests check available credits before execution.

For procurement, verify current Pangea pricing in the console or directly with the vendor rather than copying an old price from a third-party article.

Best Use Case for Pangea

Choose Pangea when cryptographic proof is a major requirement, audit-log integrity is part of your security story, customers require long retention, redaction and security controls matter, or the application already uses other Pangea/CrowdStrike security services.

3. Retraced for Open-Source and Self-Hosted Audit Logs

Retraced is still relevant, but its positioning in 2026 needs to be updated.

The Retraced GitHub repository describes it as a fully open-source audit-log service with an embeddable UI that can be deployed into your own Kubernetes environment. The repository uses the Apache 2.0 license, and there is an official Node.js client.

Historically, Retraced was closely associated with BoxyHQ. However, Ory acquired BoxyHQ in 2025. The current BoxyHQ signup page states that BoxyHQ has been acquired and is no longer accepting new signups, with existing customers unaffected.

That means a new SaaS team should not assume that the old Retraced managed-service pricing and onboarding model is still the commercial path.

Where Retraced Still Makes Sense

Retraced remains interesting when you explicitly want an open-source audit-log service, self-hosting is required, Kubernetes is already part of your platform, you want an embeddable log viewer, or you prefer source-level control over a managed API dependency.

The repository supports searchable and exportable audit logs and includes Docker Compose and Kubernetes-oriented deployment paths. The JavaScript client can publish events and issue viewer tokens for the embedded UI.

Important 2026 Caveat

Open source does not automatically mean low operational cost.

A self-hosted audit-log system needs durable storage, backups, retention enforcement, search infrastructure, tenant isolation, encryption, disaster recovery, upgrade management, vulnerability management, access controls, monitoring, and export pipelines.

For a small engineering team, the managed API price may be cheaper than the real staff cost of owning that stack. Retraced is most compelling when infrastructure control is itself a requirement, not merely because the license is free.

4. Building Audit Logs Yourself

A lot of Node.js teams initially build audit logs with a PostgreSQL table containing tenant_id, user_id, action, JSON payload, and created_at. That is not a bad start. It is just not a complete audit-log product.

The missing work usually appears later: preventing edits, proving integrity, indexing years of data, per-tenant retention, safe export, customer-facing filtering, SIEM connectors, redaction, data residency, legal holds, idempotency, retry behavior, schema evolution, API authorization, and bulk-export performance.

If audit logging is not a differentiating feature for your product, buying this infrastructure is often rational.

Whether you use WorkOS, Pangea, Retraced, or your own storage, the application architecture should avoid a fragile pattern where a user request succeeds but the audit event disappears.

A stronger pattern is:

HTTP request
     |
     v
Node.js business transaction
     |
     +--> Product database
     |
     +--> Audit outbox record
             |
             v
     Background worker
             |
             v
     Audit log provider
             |
     +-------+-------+
     |               |
     v               v
Customer viewer  SIEM / archive

Why Use an Outbox?

If your application updates business data and then calls an audit provider synchronously, you have a failure gap: the database update can succeed while the external audit call times out.

A transactional outbox reduces that gap. The business change and the outbox event are written in the same database transaction. A worker then delivers the event to the audit provider with retry and idempotency.

For critical enterprise events, that reliability is usually worth the extra component.

A Vendor-Neutral TypeScript Event Model

Use one canonical event model inside your application even if the external provider changes.

export type AuditActor =
  | { type: "user"; id: string; email?: string }
  | { type: "system"; id: string }
  | { type: "api_key"; id: string };

export interface AuditTarget {
  type: string;
  id: string;
  name?: string;
}

export interface AuditEvent {
  id: string;
  tenantId: string;
  action: string;
  occurredAt: string;
  actor: AuditActor;
  targets: AuditTarget[];
  context?: {
    ip?: string;
    userAgent?: string;
    requestId?: string;
  };
  metadata?: Record<string, string | number | boolean | null>;
}

Then write provider adapters behind an AuditSink interface. This prevents the rest of your SaaS codebase from becoming tightly coupled to one vendor’s event format.

What Should a B2B SaaS Product Log?

Do not log everything. Log actions that matter during security review, incident response, support investigation, or customer administration.

High-value categories include:

  • Authentication events
  • Password resets and MFA changes
  • SSO configuration changes
  • Role and permission changes
  • API-key creation or deletion
  • Member invitations/removals
  • Organization setting changes
  • Large exports
  • Privileged access to sensitive records
  • Subscription and payment-method changes
  • Webhook-secret rotation
  • IP allowlist changes
  • SCIM changes
  • Integration installation/removal

What Not to Put in an Audit Event

Audit logs often have longer retention than ordinary application data, so data minimization matters.

Avoid storing:

  • Passwords
  • Session tokens
  • Raw API keys
  • OAuth access tokens
  • Private encryption keys
  • Full payment-card data
  • Unnecessary request bodies
  • Secrets embedded in URLs
  • Sensitive personal data not required for the audit purpose

If you need old/new values, whitelist the exact fields that are safe to retain. Do not serialize entire database rows into the audit log by default.

Multi-Tenant Isolation Is Non-Negotiable

For SaaS, audit logs are usually customer-visible. A tenant-isolation mistake is therefore a direct data breach.

Every event should have an immutable tenant or organization identifier. Every search, export, and viewer token must be scoped to that tenant.

Do not trust a browser-supplied organization ID by itself. Resolve organization scope from the authenticated server-side session, API key, or verified service identity.

SIEM Streaming Becomes Important Earlier Than You Expect

Small customers are usually happy with a filterable audit-log page. Enterprise security teams may ask for Splunk, Datadog, S3, Snowflake, Google Cloud Storage, generic HTTP delivery, or other SIEM destinations.

This can become a meaningful engineering project. That is one reason WorkOS becomes attractive: the connector layer is already part of the product.

If you self-host, plan the streaming architecture before the first enterprise customer asks for it.

Retention Should Be a Product Decision

Do not hard-code “90 days” because it sounds reasonable.

Retention may depend on contract tier, compliance framework, geographic requirement, customer policy, event category, or legal hold.

A practical SaaS model is to support plan-based defaults and customer-specific overrides. The storage layer should also distinguish between hot searchable data, lower-cost warm data, and archive-only cold data.

Reliability Rules for Audit Event Delivery

A production Node.js implementation should:

  1. Generate an event ID before delivery.
  2. Use an idempotency key where the provider supports it.
  3. Persist critical events before asynchronous delivery.
  4. Retry with exponential backoff.
  5. Use a dead-letter queue for repeated failures.
  6. Alert on delivery backlog age.
  7. Track the last successfully delivered event.
  8. Never silently drop events when a provider returns 429.
  9. Preserve the original occurred_at timestamp.
  10. Separate event occurrence time from ingestion time.

Buying Decision by SaaS Stage

Pre-PMF or Small B2B SaaS

Start with a clean internal event model and a simple append-only database table. Do not overbuild the UI. The goal is to avoid rewriting event semantics later.

Growing B2B SaaS

If enterprise deals are beginning to require SSO, SCIM, audit logs, and security questionnaires, WorkOS is the most straightforward default. The value is engineering speed.

Security-Heavy or Regulated Product

If evidence integrity and long retention are explicit product requirements, evaluate Pangea Secure Audit Log seriously. Its tamperproof verification model is the differentiator.

Self-Hosted / Private Cloud Product

If customers require their audit infrastructure inside their environment, an open-source system such as Retraced can be a useful starting point. Budget for operations and dependency maintenance.

Very Large Platform

At sufficient scale, a custom system may make economic or architectural sense. Typical components might include Kafka or another durable event bus, immutable object storage, ClickHouse/OpenSearch, retention workers, tenant-aware export services, SIEM connectors, cryptographic integrity controls, and a dedicated customer-facing audit-log service.

At that point, the audit log is a real platform, not a table.

Final Recommendation

For most Node.js B2B SaaS applications in 2026:

  • Choose WorkOS Audit Logs if you want the fastest path to enterprise-ready customer audit logs, SIEM streaming, and a polished administrative experience.
  • Choose Pangea Secure Audit Log if cryptographic tamperproofing, security evidence, and long retention are first-class requirements.
  • Choose Retraced when self-hosting and open-source control are explicit requirements, while recognizing the current BoxyHQ/Ory commercial transition and the operational responsibility you will own.
  • Build your own only when your deployment, regulation, scale, or product strategy makes audit logging part of your differentiated infrastructure.

The most important design decision is not the vendor. It is treating audit logs as durable product data.

If your customers cannot trust the record during the worst day they have with your product, the implementation has failed no matter how easy it was to add the first audit.log() call.

FAQ

Do I need audit logs if I already use Datadog or another log platform?

Usually yes for B2B enterprise SaaS. Operational logging platforms are optimized for engineering telemetry. Customer audit logs need tenant-scoped product semantics, customer access, retention policy, exports, and often SIEM integration.

Can I keep audit logs in PostgreSQL?

You can, especially at an early stage. But a normal mutable table is not automatically an enterprise audit-log solution. You still need append-only controls, access isolation, export, retention, query performance, backup strategy, and potentially tamper evidence.

Should audit-log delivery block the API request?

Usually not. For critical actions, write an audit outbox record in the same transaction as the business change, then deliver asynchronously.

Should I log every database read?

Not necessarily. Log security-relevant and contractually important reads, especially sensitive exports or privileged access. Logging every low-value read can create enormous cost and noise.

Is Kafka an audit-log system?

No. Kafka can be part of the delivery pipeline, but you still need durable retention, search, tenant isolation, access controls, customer UI, export, and evidence-integrity behavior.

How long should SaaS audit logs be retained?

There is no universal answer. Retention should be driven by customer requirements, contracts, compliance obligations, data-minimization rules, and product packaging.

Sources Verified on August 27, 2026

FAQ

Do I need audit logs if I already use Datadog or another log platform?
Usually yes for B2B enterprise SaaS. Operational logging platforms are optimized for engineering telemetry, while customer audit logs need tenant-scoped product semantics, customer access, retention policy, exports, and often SIEM integration.
Can I keep audit logs in PostgreSQL?
You can, especially at an early stage, but a normal mutable table is not automatically an enterprise audit-log solution. You still need append-only controls, access isolation, export, retention, query performance, backups, and potentially tamper evidence.
Should audit-log delivery block the API request?
Usually not. For critical actions, write an audit outbox record in the same transaction as the business change, then deliver it asynchronously with retries.
How long should SaaS audit logs be retained?
There is no universal answer. Retention should be driven by customer requirements, contracts, compliance obligations, data-minimization rules, and product packaging.