From bcfd3c335cbbcee620499adca6592d86e8f4d933 Mon Sep 17 00:00:00 2001 From: Matt Hatcher <3768988+MatthewSH@users.noreply.github.com> Date: Mon, 13 Oct 2025 11:05:09 -0400 Subject: [PATCH] docs: fix incorrect option for session in API key plugin (#5273) --- docs/content/docs/plugins/api-key.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/docs/plugins/api-key.mdx b/docs/content/docs/plugins/api-key.mdx index c810ede205..2d5ba413a4 100644 --- a/docs/content/docs/plugins/api-key.mdx +++ b/docs/content/docs/plugins/api-key.mdx @@ -384,7 +384,7 @@ Any time an endpoint in Better Auth is called that has a valid API key in the he export const auth = betterAuth({ plugins: [ apiKey({ - sessionForAPIKeys: true, + enableSessionForAPIKeys: true, }), ], }); @@ -725,9 +725,9 @@ Customize the rate-limiting. Custom schema for the API key plugin. -`disableSessionForAPIKeys` `boolean` +`enableSessionForAPIKeys` `boolean` -An API Key can represent a valid session, so we automatically mock a session for the user if we find a valid API key in the request headers. +An API Key can represent a valid session, so we can mock a session for the user if we find a valid API key in the request headers. Default is `false`. `permissions` `{ defaultPermissions?: Statements | ((userId: string, ctx: GenericEndpointContext) => Statements | Promise) }`