Overview
TheAuthConfig interface defines all configuration options for initializing Arraf Auth with createAuth.
Fields
A secret key used for signing and encrypting session tokens. This should be a long, random string stored securely in environment variables.
The database adapter instance for persisting users, sessions, accounts, and verifications.See Database Adapter API, Prisma Adapter, and Drizzle Adapter for details.
Session configuration including strategy, expiration, and cookie settings. Defaults to JWT strategy with 7 days expiration.See SessionConfig for all available options.
Array of OAuth providers for social authentication (Google, GitHub, etc.).See OAuth Provider API, Google Provider, and GitHub Provider for details.
Array of plugins to extend Arraf Auth functionality with custom routes and hooks.Plugins can add custom routes and lifecycle hooks for sign-in, sign-up, and OTP verification events.
SMS provider for sending OTP codes via text message.See SMS Provider API for implementation details and examples.
Configuration for one-time password (OTP) behavior including length, expiration, and message templates.See OTPConfig for all available options.
Array of trusted origin URLs for CORS and CSRF protection. Requests from origins not in this list will be rejected.
Always include all domains where your frontend application runs.