diff --git a/docs/components/sidebar-content.tsx b/docs/components/sidebar-content.tsx index 9351b964..722bda5b 100644 --- a/docs/components/sidebar-content.tsx +++ b/docs/components/sidebar-content.tsx @@ -468,4 +468,17 @@ export const contents: Content[] = [ }, ], }, + { + title: "Guides", + Icon: () => ( + + ), + list: [{ + title: "Setting up Login with Github", + href: "/docs/guides/github-login", + icon: () => ( + + ) + }] + } ]; diff --git a/docs/content/docs/basic-usage.mdx b/docs/content/docs/basic-usage.mdx index 8fdefb9d..d2449add 100644 --- a/docs/content/docs/basic-usage.mdx +++ b/docs/content/docs/basic-usage.mdx @@ -3,9 +3,9 @@ title: Basic Usage description: Usage --- -## Signin and Signup with Email +## Sign-in & Sign-up with Email & Password -To use signin and signup with email, you need to configure the email and password authenticator. You can do this by adding the following code to your `auth.ts` file: +To use email and password as authentication startgey, you need to enable `emailAndPassword` in the `auth` config. ```ts title="auth.ts" twoslash import { betterAuth } from "better-auth" @@ -200,7 +200,7 @@ the client providers a `useSession` hook or a `session` object that you can use ```svelte title="user.svelte"
- ### Create Server + ### Create A Better Auth Instance better auth requries a file called `auth.ts` or `auth.config.ts` to be present in the root directory or one of the following directories: - `lib/` - `utils/` @@ -160,6 +160,10 @@ description: Installation ### Create Client better auth client comes with a support for differnt frameworks including React, Vue, Svelte, and Solid. You can also use it with vanilla javascript. + + + Make sure you import the client from the correct path. + ```ts diff --git a/docs/content/docs/integrations/svelte-kit.mdx b/docs/content/docs/integrations/svelte-kit.mdx index d2d861ea..e2994ec1 100644 --- a/docs/content/docs/integrations/svelte-kit.mdx +++ b/docs/content/docs/integrations/svelte-kit.mdx @@ -123,7 +123,7 @@ Some of the actinos are reactive. The client use [nano-store](https://github.com
``` -### Example: Getting Session on a ServerComponent +### Example: Getting Session on a loader ```ts title="+page.ts" import { auth } from "$lib/auth"; diff --git a/docs/package.json b/docs/package.json index 806b68f7..eb8825a0 100644 --- a/docs/package.json +++ b/docs/package.json @@ -41,7 +41,7 @@ "@tsparticles/engine": "^3.5.0", "@tsparticles/react": "^3.0.0", "@tsparticles/slim": "^3.5.0", - "better-auth": "^0.0.4", + "better-auth": "workspace:0.0.8-beta.5", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "cmdk": "1.0.0", diff --git a/examples/next-js/src/app/(auth)/sign-in/page.tsx b/examples/next-js/src/app/(auth)/sign-in/page.tsx index d260f422..c59d1ef4 100644 --- a/examples/next-js/src/app/(auth)/sign-in/page.tsx +++ b/examples/next-js/src/app/(auth)/sign-in/page.tsx @@ -13,6 +13,7 @@ import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { PasswordInput } from "@/components/ui/password-input"; import { authClient } from "@/lib/auth-client"; +import { GitHubLogoIcon } from "@radix-ui/react-icons"; import { Key } from "lucide-react"; import Link from "next/link"; import { useRouter } from "next/navigation"; @@ -95,7 +96,7 @@ export default function Page() { +