{"repo":"ejirocodes/better-auth-audit-logs","free":true,"listed":false,"github":"https://github.com/ejirocodes/better-auth-audit-logs","clone":"git clone https://github.com/ejirocodes/better-auth-audit-logs.git","description":"Audit log plugin for Better Auth. Auto-captures auth events with severity inference, PII redaction, custom storage backends, and retention policies.","language":"TypeScript","stars":48,"topics":["audit","audit-log","authentication","better-auth","gdpr","plugin","soc2","typescript"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"better-auth-audit-logs Audit log plugin for Better Auth. Automatically captures auth events with IP, user agent, and severity — zero config required. Requires better-auth = 1.0.0 and typescript = 5 . Quick start Then generate and run the migration: That's it. All auth events are now logged automatically. Schema The plugin adds an auditLog table. If you prefer to manage your schema manually, copy the relevant definition: Prisma Drizzle MongoDB Client plugin What gets logged All auth POST endpoints are captured by default: Event Path Hook --- --- --- Sign in /sign-in/email , /sign-in/social after Sign up /sign-up/email after Change/reset password /change-password , /reset-password after Change email /change-email after Two-factor /two-factor/ after OAuth callback /oauth/callback after Sign out /sign-out before Delete account /delete-user before Revoke session /revoke-session , /revoke-sessions , /revoke-other-sessions before \"Before\" hooks fire for destructive events where the session would be lost after execution. Severity is inferred automatically ( critical for ban/impersonate, high for delete/revoke/failed sign-in, medium for sign-in/out, low for everything else) and can be overridden per-path. Configuration All options are optional: To override the DB model name, pass schema: { auditLog: { modelName: \"your table name\" } } . Custom storage Route writes to any external backend instead of Better Auth's database: A MemoryStorage adapter is included for testing: API endpoints T","default_branch":null,"files":null,"tree":[],"storefront":"/r/ejirocodes","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ejirocodes/better-auth-audit-logs/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}