Overview
Theevents field in StudioConfig controls how authentication events are captured, stored, and displayed. Events provide visibility into user actions like sign-ups, logins, password changes, and more.
Type Definition
Fields
Enable or disable event tracking.Default:
falseExample:Name of the database table to store events. When provided, Studio will automatically use your Better Auth adapter.Example:
Custom event ingestion provider. Implement this interface for custom event storage backends.
Database client instance (Postgres pool, Prisma client, Drizzle instance, ClickHouse client, etc.).Used when you want Studio to manage event storage using your existing database connection.
Type of database client being used.Options:
"postgres"- PostgreSQL client"prisma"- Prisma client"drizzle"- Drizzle ORM"clickhouse"- ClickHouse client"sqlite"- SQLite"node-sqlite"- Node SQLite"https"- HTTP/HTTPS endpoint"custom"- Custom client
Whitelist of event types to track. Only these events will be captured.Example:See Event Types for the complete list.
Blacklist of event types to ignore. All events except these will be captured.Example:See Event Types for the complete list.
Number of events to batch before flushing to storage.Default:
10Example:Time interval (in milliseconds) to automatically flush events to storage.Default:
5000 (5 seconds)Example:Whether to retry event ingestion on failure.Default:
trueExample:Configuration for the live events marquee display in the Studio UI.Example:
Callback function invoked when an event is ingested. Use this for custom event processing, logging, or analytics.Example:
Event Types
Complete list of availableAuthEventType values:
User Events
"user.joined"- User registration/sign-up"user.logged_in"- User login"user.logged_out"- User logout"user.updated"- User profile updated"user.password_changed"- Password changed"user.email_verified"- Email verification completed"user.banned"- User banned"user.unbanned"- User unbanned"user.deleted"- User account deleted"user.delete_verification_requested"- Account deletion verification requested
Organization Events
"organization.created"- Organization created"organization.updated"- Organization updated"organization.deleted"- Organization deleted"member.added"- Member added to organization"member.removed"- Member removed from organization"member.role_changed"- Member role changed
Team Events
"team.created"- Team created"team.updated"- Team updated"team.deleted"- Team deleted"team.member.added"- Member added to team"team.member.removed"- Member removed from team
Session Events
"session.created"- New session created"login.failed"- Failed login attempt
Password Events
"password.reset_requested"- Password reset requested"password.reset_completed"- Password reset completed"password.reset_requested_otp"- Password reset via OTP requested"password.reset_completed_otp"- Password reset via OTP completed
OAuth Events
"oauth.linked"- OAuth account linked"oauth.unlinked"- OAuth account unlinked"oauth.sign_in"- Sign in via OAuth
Invitation Events
"invitation.created"- Invitation sent"invitation.accepted"- Invitation accepted"invitation.rejected"- Invitation rejected"invitation.cancelled"- Invitation cancelled
Phone Number Events
"phone_number.otp_requested"- Phone number OTP requested"phone_number.verification"- Phone number verified
AuthEvent Interface
Usage Examples
Basic Setup with Adapter
With Prisma Client
Selective Event Tracking
With Custom Event Processing
Full Configuration with Live Marquee
Related
- StudioConfig - Main configuration object
- StudioAccessConfig - Access control configuration
- StudioMetadata - Metadata and branding