docs: advanced field includes the option to generateId (#1756)

This commit is contained in:
Maxwell
2025-03-12 21:09:02 +10:00
committed by GitHub
parent 5c65155f53
commit c110da21a9

View File

@@ -371,7 +371,14 @@ export const auth = betterAuth({
httpOnly: true, httpOnly: true,
secure: true secure: true
}, },
cookiePrefix: "myapp" cookiePrefix: "myapp",
generateId: ((options: {
model: LiteralUnion<Models, string>;
size?: number;
}) => {
// Generate a unique ID for the model
return "my-id";
})
}, },
}) })
``` ```
@@ -383,6 +390,7 @@ export const auth = betterAuth({
- `cookies`: Customize cookie names and attributes - `cookies`: Customize cookie names and attributes
- `defaultCookieAttributes`: Default attributes for all cookies - `defaultCookieAttributes`: Default attributes for all cookies
- `cookiePrefix`: Prefix for cookies - `cookiePrefix`: Prefix for cookies
- `generateId`: Function to generate a unique ID for a model
## `databaseHooks` ## `databaseHooks`