Skip to content

Commit

Permalink
chore: correct docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bekacru committed Nov 2, 2024
1 parent e6363ff commit 9506523
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 16 deletions.
12 changes: 8 additions & 4 deletions demo/nextjs/lib/auth.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { betterAuth } from "better-auth";
import { bearer, admin, multiSession } from "better-auth/plugins";
import { organization } from "better-auth/plugins/organization";
import { passkey } from "better-auth/plugins/passkey";
import { twoFactor } from "better-auth/plugins/two-factor";
import {
bearer,
admin,
multiSession,
organization,
passkey,
twoFactor,
} from "better-auth/plugins";
import { reactInvitationEmail } from "./email/invitation";
import { LibsqlDialect } from "@libsql/kysely-libsql";
import { reactResetPasswordEmail } from "./email/rest-password";
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/plugins/admin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The Admin plugin provides a set of administrative functions for user management

```ts title="auth.ts"
import { betterAuth } from "better-auth"
import { admin } from "better-auth/plugins/admin" // [!code highlight]
import { admin } from "better-auth/plugins" // [!code highlight]
export const auth = betterAuth({
// ... other config options
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/plugins/anonymous.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The Anonymous plugin allows users to have an authenticated experience without re

```ts title="auth.ts"
import { betterAuth } from "better-auth"
import { anonymous } from "better-auth/plugins/anonymous" // [!code highlight]
import { anonymous } from "better-auth/plugins" // [!code highlight]
export const auth = betterAuth({
// ... other config options
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/plugins/bearer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Add the Bearer plugin to your authentication setup:

```ts title="auth.ts"
import { betterAuth } from "better-auth";
import { bearer } from "better-auth/plugins/bearer";
import { bearer } from "better-auth/plugins";

export const auth = betterAuth({
plugins: [bearer()]
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/plugins/email-otp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You can't register a user using the email OTP plugin. You can only sign in or ve

```ts title="auth.ts"
import { betterAuth } from "better-auth"
import { emailOTP } from "better-auth/plugins/email-otp" // [!code highlight]
import { emailOTP } from "better-auth/plugins" // [!code highlight]
export const auth = betterAuth({
// ... other config options
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/plugins/generic-oauth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The Generic OAuth plugin provides a flexible way to integrate authentication wit

```ts title="auth.ts"
import { betterAuth } from "better-auth"
import { genericOAuth } from "better-auth/plugins/generic-oauth" // [!code highlight]
import { genericOAuth } from "better-auth/plugins" // [!code highlight]
export const auth = betterAuth({
// ... other config options
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/plugins/jwt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The JWT plugin provides endpoints to retrieve a JWT token and a JWKS endpoint to
### Add the plugin to your **auth** config
```ts title="auth.ts"
import { betterAuth } from "better-auth"
import { jwt, bearer } from "better-auth/plugins/jwt"
import { jwt, bearer } from "better-auth/plugins"

export const auth = betterAuth({
plugins: [ // [!code highlight]
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/plugins/magic-link.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Magic link or email link is a way to authenticate users without a password. When

```ts title="server.ts"
import { betterAuth } from "better-auth";
import { magicLink } from "better-auth/plugins/magic-link";
import { magicLink } from "better-auth/plugins";

export const auth = betterAuth({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/plugins/multi-session.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The multi-session plugin allows users to maintain multiple active sessions acros
### Add the plugin to your **auth** config
```ts title="auth.ts"
import { betterAuth } from "better-auth"
import { multiSession } from "better-auth/plugins/multi-session"
import { multiSession } from "better-auth/plugins"

export const auth = betterAuth({
plugins: [ // [!code highlight]
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/plugins/organization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Organizations simplifies user access and permissions management. Assign roles an
### Add the plugin to your **auth** config
```ts title="auth.ts"
import { betterAuth } from "better-auth"
import { organization } from "better-auth/plugins/organization"
import { organization } from "better-auth/plugins"

export const auth = betterAuth({
plugins: [ // [!code highlight]
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/plugins/passkey.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The passkey plugin implementation is powered by [simple-web-authn](https://simpl

```ts title="auth.ts"
import { betterAuth } from "better-auth"
import { passkey } from "better-auth/plugins/passkey"
import { passkey } from "better-auth/plugins"

export const auth = betterAuth({

Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/plugins/phone-number.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The phone number plugin extends the authentication system by allowing users to s

```ts title="auth.ts"
import { betterAuth } from "better-auth"
import { phoneNumber } from "better-auth/plugins/phone-number"
import { phoneNumber } from "better-auth/plugins"

const auth = betterAuth({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/plugins/username.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The username plugin wraps the email and password authenticator and adds username

```ts title="auth.ts"
import { betterAuth } from "better-auth"
import { username } from "better-auth/plugins/username"
import { username } from "better-auth/plugins"

const auth = betterAuth({
plugins: [ // [!code highlight]
Expand Down

0 comments on commit 9506523

Please sign in to comment.