Better-Auth Enchanced/Plugins
Age Restriction
This plugin provides age verification and restriction features for Better Auth applications. It allows you to add age-based access restrictions to specific content or services.
Installation
To use this plugin in your application, you need to register it in both client and server configurations.
Initialize plugin
Usage
To verify age:
To check age status:
API
| Prop | Type | Default |
|---|---|---|
schema? | Record<string, any> | - |
reverificationPeriod? | number | 365 |
verificationMethods? | string[] | ["birthdate"] |
requireOnSignUp? | boolean | false |
minimumAge? | number | 18 |
enabled? | boolean | true |
Error Codes
| Code | Description |
|---|---|
AGE_VERIFICATION_REQUIRED | Age verification is required |
MINIMUM_AGE_REQUIRED | You need to meet the minimum age requirement |
BIRTHDATE_REQUIRED | Birthdate information is required |
INVALID_BIRTHDATE | Invalid birthdate |
VERIFICATION_FAILED | Age verification failed |
SYSTEM_DISABLED | Age restriction system is currently disabled |
Feedback
This plugin provides feedback collection and management for your Better Auth application. By default, authentication is required to submit feedback, but this can be configured.
Blacklist & Whitelist
This plugin provides advanced blacklist and whitelist management for Better Auth. It allows you to block or allow specific users from accessing your application.