Skip to main content
Docs/Audit Log
DocsAudit Log
Free

Audit Log

A per-app structured event log SDK at window.genmb.audit. Record sensitive actions explicitly, query them owner-only later for compliance or incident review.

Writing Entries

Call window.genmb.audit.log() from your client code or from a backend handler. The platform stamps the resolved user, IP, and user-agent automatically.

await window.genmb.audit.log({
  action: 'order.refund',
  targetType: 'order',
  targetId: order.id,
  metadata: { amount: 49.99, reason: 'damaged' },
})
Use a stable, dotted action name (user.role.change, product.delete). Filtering and aggregation are much easier when actions are predictable strings.

Reading Entries

List endpoint supports pagination and filters by action, user, target type, and date range. Owner or admin role required.

End-users of your generated app cannot list the audit log. Surface findings in your admin UI or export periodically to your warehouse.

Security

  • Entries are append-only via the SDK. There is no public update or delete endpoint.
  • The actor identity is resolved from the session, not user-supplied, to prevent forgery.
  • IP and user-agent are stamped server-side for the same reason.

Limits

  • Standard API rate limits apply to log calls (200 req / min / IP).
  • Each entry is bounded by the platform metadata size cap; keep metadata small (under ~10 KB).
  • Available on all plans, including Free.

For broader app-level activity (codegen, deploys, plan-billing), the platform's own team activity log covers GenMB-side events.

FAQs

What is the Audit Log SDK for?
It is a structured event log per app. Use it to record sensitive actions (an admin changed a price, a user accessed a record, a refund was issued) so you can answer "who did what, when" later. Owner / admin only on read.
How is this different from analytics?
App Analytics is anonymous visitor tracking (page views, sessions). Audit Log is identified, action-level events suitable for compliance and post-incident review.
What is recorded automatically?
Nothing. You explicitly call window.genmb.audit.log() from your handler when you want an entry. This keeps the log tight; only events you care about end up there.
How long are entries kept?
Indefinitely, subject to the underlying database retention. Trim with periodic deletes via a scheduled agent if you need a retention window.

Ready to build?

Create your first app for free, no credit card required.