diff --git a/docs/content/docs/reference/options.mdx b/docs/content/docs/reference/options.mdx index 9305052fbb..5182b22b1b 100644 --- a/docs/content/docs/reference/options.mdx +++ b/docs/content/docs/reference/options.mdx @@ -649,6 +649,26 @@ export const auth = betterAuth({ * `skipTrailingSlashes`: Skip trailing slash validation in route matching. (default: `false`) * OAuth state configuration options (`storeStateStrategy`, `skipStateCookieCheck`) are now part of the `account` option +

database

+ +Set custom strategies for ID generation and findMany queries. + +* `generateId`: Controls how record IDs are generated. Accepts a custom function, `false`, `"serial"`, or `"uuid"` (default: [random base62 string](https://github.com/better-auth/better-auth/blob/main/packages/core/src/utils/id.ts)). See the [Database documentation](/docs/concepts/database#id-generation) for more info. +* `defaultFindManyLimit`: The default maximum number of records returned by the `findMany` adapter method. (default: `100`) + +```ts +import { betterAuth } from "better-auth"; + +export const auth = betterAuth({ + advanced: { + database: { + generateId: "uuid", + defaultFindManyLimit: 50, + }, + }, +}); +``` + ### `backgroundTasks` Configure background task handling for deferred operations. Background tasks allow non-critical operations (like cleanup, analytics, timing-attack mitigation, or rate limit counter updates) to run after the response is sent. This can significantly improve response times on serverless platforms.