diff --git a/docs/content/docs/concepts/plugins.mdx b/docs/content/docs/concepts/plugins.mdx index e21af76b17..d875f5bf9e 100644 --- a/docs/content/docs/concepts/plugins.mdx +++ b/docs/content/docs/concepts/plugins.mdx @@ -20,10 +20,11 @@ export const auth = betterAuth({ plugins: [ // Add your plugins here ] -}) +}); ``` Client plugins are added when creating the client. Most plugin require both server and client plugins to work correctly. +The Better-Auth auth client on the frontend uses the `createAuthClient` function provided by `better-auth/client`. ```ts title="auth-client.ts" import { createAuthClient } from "better-auth/client"; @@ -32,9 +33,17 @@ const authClient = createAuthClient({ plugins: [ // Add your client plugins here ] -}) +}); ``` +We recommend keeping the auth-client and your normal auth instance in separate files. + + + + + + + ## Creating a Plugin To get started, you'll need a server plugin.