From 39839ee6b6cbff6e6178cd69335deca70dd996c7 Mon Sep 17 00:00:00 2001 From: Bereket Engida Date: Sun, 17 Nov 2024 12:09:53 +0300 Subject: [PATCH] docs: add comparison --- docs/components/landing/hero.tsx | 13 ++++++------ docs/components/sidebar-content.tsx | 19 +++++++++++++++++ docs/content/docs/comparison.mdx | 33 +++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 docs/content/docs/comparison.mdx diff --git a/docs/components/landing/hero.tsx b/docs/components/landing/hero.tsx index cb2e9f746b..6326d44123 100644 --- a/docs/components/landing/hero.tsx +++ b/docs/components/landing/hero.tsx @@ -24,10 +24,9 @@ const tabs: { name: "auth.ts" | "client.ts"; code: string }[] = [ { name: "auth.ts", code: `export const auth = betterAuth({ - database: { - provider: "postgresql", - url: process.env.DATABASE_URL, - }, + database: new Pool({ + connectionString: process.env.DATABASE_URL, + }), emailAndPassword: { enabled: true, }, @@ -75,7 +74,7 @@ export default function Hero() {

- The authentication and authorization framework for TypeScript. + The most comprehensive authentication framework for TypeScript.

{ <> @@ -148,7 +147,7 @@ function CodePreview() { 0 ? height : undefined }} - className="from-stone-100 to-stone-200 dark:from-stone-950/70 dark:to-stone-950/90 relative overflow-hidden rounded-sm bg-gradient-to-tr ring-1 ring-white/10 backdrop-blur-lg" + className="from-stone-100 to-stone-200 dark:to-black/90 dark:via-stone-950/10 dark:from-stone-950/90 relative overflow-hidden rounded-sm bg-gradient-to-tr ring-1 ring-white/10 backdrop-blur-lg" >
@@ -260,7 +259,7 @@ function CodePreview() { ), }, + { + title: "Comparison", + href: "/docs/comparison", + icon: () => ( + + + + ), + }, { title: "Installation", href: "/docs/installation", diff --git a/docs/content/docs/comparison.mdx b/docs/content/docs/comparison.mdx new file mode 100644 index 0000000000..cba6fe0489 --- /dev/null +++ b/docs/content/docs/comparison.mdx @@ -0,0 +1,33 @@ +--- +title: Comparison +description: Comparison of Better Auth with other auth libraries and services. +--- + +> Comparison is the thief of joy. – Kanye West + +### vs Other Auth Libraries + +- We probably support the framework you are using. +- You need more featuers from your auth library. +- You need advanced features like two-factor authentication, multi-tenancy, multi-session, admin tools, rate limiting, etc. +- You want to have more control over your auth flow. +- You prefer more comprehensive documentation. + +### vs Self Hosted Auth Server +- You want to keep your users on your own database (the same database as your app). +- You need more control over your auth flow. +- You don't want the hassle of self-hosting your auth server. +- And there is a high possibilty that we cover more features you need. And you can alway extends it using our plugin system. + +### vs Managed Auth Services (paid) + +- You don’t want to give up user data to a third party. +- You want a single source of truth for your users. +- You prefer not to pay for authentication. +- You want to keep your users on your own database (the same database as your app). + +### vs Roll Your Own Auth + +- You don’t want to maintain a lot of code that isn’t your core business. +- You want to deligate the security to a community of people who probably care more than you do. +- We probably cover most of the features you need, and you can always extend it using our plugin system. \ No newline at end of file