---
name: bijection-audit-log
description: "Evaluate and integrate the Audit Log component with Bijection."
---

# Audit Log

Application activity records

- Package: @bijectionhq/audit-log
- Category: Database & Backend
- Status: Reference
- License: Apache-2.0
- Bijection source (repository access required): https://github.com/bijectionhq/audit-log/tree/b067f6d062cfa6831c0b7ae7ae1dbdf11e6746d7
- Upstream: https://github.com/robertalv/audit-log/tree/f2c237560566bb33ba4fe30cff9000734aa39c0b
- Documentation: https://docs.bijection.com/components/using
- Directory: https://bijection.com/components/audit-log

## Get the source

Bijection repository access is required. Request access at https://bijection.com/contact.

```sh
git clone https://github.com/bijectionhq/audit-log.git
cd audit-log
git checkout b067f6d062cfa6831c0b7ae7ae1dbdf11e6746d7
```

## Before using this component

Read the package README at the recorded revision for setup, dependencies, and API examples. Upstream documentation describes the original package and may differ from the Bijection adaptation. This is a source candidate for evaluation. Catalog inclusion does not establish npm availability or runtime qualification. Check compatibility with your SDK and deployment before adoption. External providers run their own compute.

## Integration workflow

1. Read the source README and package manifest at the recorded revision.
2. Confirm the required SDK, dependency availability, and runtime compatibility.
3. Follow the component's documented setup and configuration. Never invent an npm install command from a catalog package name.
4. Keep credentials in the project's existing secret store.
5. Follow the project's execution rules for verification and report what was actually checked.

## Original upstream skill

The following guidance describes convex-audit-log. Its installation commands and APIs refer to the upstream package. Evaluate compatibility with the Bijection source separately.


# Convex Audit Log

## Instructions

The Convex Audit Log component provides comprehensive event tracking and change logging for Convex applications with built-in compliance features. It automatically captures who, what, when, and where for any action, tracks before/after states with diff generation, and includes PII redaction capabilities. The component offers flexible querying, real-time monitoring, anomaly detection, and pre-built React hooks for common audit log UI patterns.

### Installation

```bash
npm install convex-audit-log
```

## Use cases

- **Track user actions and system changes** for regulatory compliance (SOC 2, GDPR, HIPAA) by logging authentication events, profile updates, and data modifications with automatic before/after state capture
- **Monitor security incidents** by detecting failed login attempts, unauthorized access patterns, and suspicious activity with configurable thresholds and real-time alerts
- **Debug production issues** by maintaining a searchable history of API calls, database changes, and system events with severity levels and metadata filtering
- **Generate compliance reports** for auditors by exporting filtered audit logs as CSV or JSON with customizable retention policies and automatic cleanup
- **Build admin dashboards** with real-time event monitoring using pre-built React hooks for displaying document history, user activity, and system statistics

## How it works

The component integrates into your Convex app through `convex.config.ts` and provides an `AuditLog` class that wraps the component API. You create an audit log client in your backend functions and call methods like `log()` for single events, `logChange()` for before/after tracking with automatic diff generation, and `logBulk()` for batch operations.

Query methods include `queryByResource()` for document history, `queryByActor()` for user activity, and `search()` with advanced filtering by severity, timestamp, and tags. The component provides real-time monitoring through `watchCritical()` and analytics via `getStats()` and `detectAnomalies()` for identifying unusual event patterns.

Built-in privacy controls automatically redact PII fields specified in the configuration, while the retention system uses `cleanup()` to remove old logs based on configurable policies. React integration comes through hooks like `useAuditLogByResource()` and utility functions for formatting timestamps and styling severity levels.

## When NOT to use

- When a simpler built-in solution exists for your specific use case
- If you are not using Convex as your backend
- When the functionality provided by Convex Audit Log is not needed

## Resources

- [npm package](https://www.npmjs.com/package/convex-audit-log)
- [GitHub repository](https://github.com/robertalv/audit-log)
- [Live demo](https://audit-log-one.vercel.app/)
- [Convex Components Directory](https://www.convex.dev/components/convex-audit-log)
- [Convex documentation](https://docs.convex.dev)