Convex Audit Log

Track user actions, API calls, and system events in Convex apps with automated logging, PII redaction, and compliance features.

Installation

npm install convex-audit-log

About Convex Audit Log

Features
Automatic Event Capture - Log who, what, when, and where for any action
Change Tracking - Record before/after states with automatic diff generation
PII Redaction - Built-in privacy controls for sensitive data
Flexible Querying - Query by actor, resource, severity, time range, and more
Real-time Monitoring - Subscribe to critical events as they happen
Anomaly Detection - Detect unusual patterns in event frequency
Report Generation - Export audit logs as JSON or CSV
Configurable Retention - Automatic cleanup with customizable policies
React Hooks - Pre-built hooks for common UI patterns

Benefits

Use cases

how to add audit logging to Convex mutations

Convex Audit Log automatically captures mutation calls with actor, timestamp, and data changes. Simply wrap your mutations with the audit logger to track who made changes, what data was modified, and when it happened.

track user actions in Convex application

The component provides automatic event capture for user actions across your Convex app. It logs authentication events, data modifications, and custom business events with built-in React hooks for displaying activity feeds.

Convex compliance audit trail requirements

Convex Audit Log handles compliance needs with automatic PII redaction, configurable data retention policies, and structured export formats. It maintains immutable logs with cryptographic integrity for regulatory requirements.

detect unusual activity patterns Convex

The built-in anomaly detection monitors event frequency and patterns to flag suspicious behavior. You can subscribe to real-time alerts and configure thresholds for different event types and user roles.

Frequently asked questions

Does Convex Audit Log impact application performance?

Convex Audit Log is designed for minimal performance impact with asynchronous logging and batched writes. It leverages Convex's built-in reactivity system and only processes events that match your configured rules, avoiding unnecessary overhead.

Can I customize what data gets logged and redacted?

Yes, Convex Audit Log provides flexible configuration for event filtering and PII redaction rules. You can specify which fields to log, what to redact based on patterns or field names, and set different policies for different event types.

How do I query historical audit logs efficiently?

Convex Audit Log includes optimized database indexes and query helpers for common patterns like filtering by actor, resource, time range, or event type. The component provides React hooks that handle pagination and real-time updates automatically.

What happens to audit logs when data retention policies expire?

Convex Audit Log automatically handles cleanup based on your retention policies while maintaining referential integrity. You can configure different retention periods for different event types and export logs before deletion for long-term archival.

Can I integrate audit logs with external monitoring systems?

Convex Audit Log supports exporting logs in JSON and CSV formats, and provides webhooks for real-time event streaming. You can easily integrate with external SIEM systems, monitoring tools, or compliance platforms using the structured export APIs.

Links