From 2fdcd6ee5c4cd1e1b4d3493d4cf333eefed46e18 Mon Sep 17 00:00:00 2001 From: KinfeMichael Tariku <65047246+Kinfe123@users.noreply.github.com> Date: Thu, 22 May 2025 02:13:56 -0700 Subject: [PATCH] docs: improve clerk migration guide (#2746) --- docs/content/docs/guides/clerk-migration-guide.mdx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/content/docs/guides/clerk-migration-guide.mdx b/docs/content/docs/guides/clerk-migration-guide.mdx index 367aafba..99cb09bc 100644 --- a/docs/content/docs/guides/clerk-migration-guide.mdx +++ b/docs/content/docs/guides/clerk-migration-guide.mdx @@ -41,7 +41,7 @@ export const auth = betterAuth({ Enable the email and password in your auth config and implement your own logic for sending verification emails, reset password emails, etc. ```ts title="auth.ts" -import { admin, anonymous } from "better-auth/plugins"; +import { betterAuth } from "better-auth"; export const auth = betterAuth({ database: new Pool({ @@ -52,8 +52,7 @@ export const auth = betterAuth({ }, // [!code highlight] emailVerification: { sendVerificationEmail: async({ user, url })=>{ - // send email verification email - // implement your own logic here + // implement your logic here to send email verification } }, }) @@ -67,7 +66,7 @@ See [Email and Password](/docs/authentication/email-password) for more configura Add social providers you have enabled in your Clerk project in your auth config. ```ts title="auth.ts" -import { admin, anonymous } from "better-auth/plugins"; +import { betterAuth } from "better-auth"; export const auth = betterAuth({ database: new Pool({ @@ -142,7 +141,7 @@ export const auth = betterAuth({ ### Create the migration script - Create a new file called `migrate-clerk.ts` in your project and add the following code: + Create a new file called `migrate-clerk.ts` in the `scripts` folder and add the following code: ```ts title="scripts/migrate-clerk.ts" import { symmetricEncrypt } from "better-auth/crypto"; @@ -406,7 +405,6 @@ migrateFromClerk() console.error(error); return; } - // Handle successful sign in };