From 1863bf4df979b030e0e6bbf143fda331e51e72d7 Mon Sep 17 00:00:00 2001 From: Multinite <145994855+Multinite@users.noreply.github.com> Date: Sun, 8 Dec 2024 21:05:00 +1000 Subject: [PATCH] docs: added more info to concept/plugins (#818) --- docs/content/docs/concepts/plugins.mdx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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.