From c110da21a9b96f52c9e7f861cd90e7f263a7fc8a Mon Sep 17 00:00:00 2001 From: Maxwell <145994855+ping-maxwell@users.noreply.github.com> Date: Wed, 12 Mar 2025 21:09:02 +1000 Subject: [PATCH] docs: advanced field includes the option to `generateId` (#1756) --- docs/content/docs/reference/options.mdx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/content/docs/reference/options.mdx b/docs/content/docs/reference/options.mdx index 6ddddda4..196aa96d 100644 --- a/docs/content/docs/reference/options.mdx +++ b/docs/content/docs/reference/options.mdx @@ -371,7 +371,14 @@ export const auth = betterAuth({ httpOnly: true, secure: true }, - cookiePrefix: "myapp" + cookiePrefix: "myapp", + generateId: ((options: { + model: LiteralUnion; + 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 - `defaultCookieAttributes`: Default attributes for all cookies - `cookiePrefix`: Prefix for cookies +- `generateId`: Function to generate a unique ID for a model ## `databaseHooks`