Codapult
PricingPluginsBlogDocsDemo

The SaaS Boilerplate for Builders

© 2026 Codapult. All rights reserved.

Built with Codapult

Product

  • Pricing
  • Plugins
  • Documentation
  • SaaS template comparison

About

  • Contact

Legal

  • Privacy Policy
  • Terms of Service
All articles

Getting Started

  • Introduction
  • Quick Start
  • Project Structure
  • License and Permitted Use

Configuration

  • Environment Variables
  • App Configuration

Authentication

  • Authentication
  • OAuth Providers
  • Two-Factor & Passwordless
  • Enterprise SSO (SAML)

Database

  • Database
  • Migrations

Teams

  • Teams & Organizations
  • Permissions & RBAC
  • SCIM Provisioning

Payments

  • Payments & Billing
  • Stripe Setup
  • LemonSqueezy Setup
  • Polar Setup
  • Payment Webhooks

Api

  • API Layer
  • tRPC
  • GraphQL

Ai

  • AI Features
  • Streaming Chat
  • RAG and Semantic Search
  • Quotas and Memory

Email

  • Email
  • Email Templates

Infrastructure

  • Infrastructure
  • Self-Hosting
  • File Storage
  • Docker
  • Background Jobs
  • Terraform & Pulumi
  • Kubernetes

Ui

  • UI & Theming

I18n

  • Internationalization

Content Management

  • Content Management

Admin

  • Admin Panel

Security

  • Security

Monitoring

  • Analytics & Monitoring

Modules

  • Module Architecture
  • Waitlist
  • Audit Log
  • White-Labeling
  • Workflow Automation
  • A/B Testing
  • Welcome Page
  • Referrals
  • GDPR Export and Deletion
  • Outgoing Webhooks

Plugins

  • Plugin System
  • AI Kit Plugin
  • CRM Plugin
  • Helpdesk Plugin
  • Email Marketing Plugin

Deployment

  • Deployment
  • Troubleshooting

Upgrading

  • Upgrading Codapult

Developer Tools

  • AI Agents & IDEs
  • MCP Server
  • Testing
Modules

Audit Log

Record user and organization activity for admin review, support, and compliance.

The audit log records important product actions so admins can answer "who did what, when, and to which resource?" It is useful for B2B products, support debugging, compliance reviews, and account security screens.

Key files

FilePurpose
src/lib/activity-log.tsWrite and query audit records
src/app/api/audit-log/route.tsUser-facing audit log API
src/app/[locale]/admin/activity/Admin activity view
activity_log tableStored audit events

Writing events

Use logActivity from server actions, route handlers, or background jobs:

import { logActivity } from '@/lib/activity-log';

await logActivity({
  userId,
  action: 'subscription.updated',
  resourceType: 'subscription',
  resourceId: subscriptionId,
  metadata: { plan: 'pro' },
});

Keep event names stable. They become filters, support references, and sometimes customer-facing audit records.

Query helpers

HelperPurpose
getRecentLogs()Latest events across the app
getUserLogs(userId)Events for one user
getResourceLogs(type, id)Events for one resource
getOrgLogs(orgId)Events for one organization

Feature flag

Disable public/admin audit surfaces with:

ENABLE_AUDIT_LOG="false"

When disabled, matching routes return 404 through src/proxy.ts.

WaitlistWhite-Labeling