mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-31 03:16:42 -05:00
docs(admin): update usage instructions to include adminUserIds option
This commit is contained in:
@@ -67,7 +67,7 @@ The Admin plugin provides a set of administrative functions for user management
|
||||
|
||||
## Usage
|
||||
|
||||
Before performing any admin operations, the user must be authenticated with an admin account. An admin is any user assigned the `admin` role. For the first admin user, you'll need to manually assign the `admin` role to their account in your database.
|
||||
Before performing any admin operations, the user must be authenticated with an admin account. An admin is any user assigned the `admin` role or any user whose ID is included in the `adminUserIds` option.
|
||||
|
||||
### Create User
|
||||
|
||||
@@ -332,6 +332,16 @@ admin({
|
||||
})
|
||||
```
|
||||
|
||||
### Admin userIds
|
||||
|
||||
You can pass an array of userIds that should be considered as admin. Default to `[]`
|
||||
|
||||
```ts title="auth.ts"
|
||||
admin({
|
||||
adminUserIds: ["user_id_1", "user_id_2"]
|
||||
})
|
||||
```
|
||||
|
||||
### impersonationSessionDuration
|
||||
|
||||
The duration of the impersonation session in seconds. Defaults to 1 hour.
|
||||
|
||||
Reference in New Issue
Block a user