Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 36 additions & 16 deletions examples/next/app/docs/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ description: A comprehensive authentication and authorization framework for Type
icon: book
---

# Introduction

Better Auth is a framework-agnostic, universal authentication and authorization framework for TypeScript. It provides a comprehensive set of features out of the box and includes a plugin ecosystem that simplifies adding advanced functionalities.
# Introduction intro

<Agent>
You are reading the example docs entry page as an implementation agent.
Expand All @@ -21,32 +19,24 @@ Prefer markdown reads over HTML scraping. For Next.js, `/docs.md`, `/docs/<slug>
page-level machine-readable entry points when reported by the spec.
</Agent>

## Features
###### Features:

- **Framework Agnostic** — Support for most popular frameworks
- **Email & Password** — Built-in support for secure email and password authentication
- **Account & Session Management** — Manage user accounts and sessions with ease
- **Built-In Rate Limiter** — Built-in rate limiter with custom rules
- **Automatic Database Management** — Automatic database management and migrations
- **Social Sign-on** — Multiple social sign-on providers
- **Plugin Ecosystem** — Even more capabilities with plugins
Better Auth is a framework-agnostic, universal authentication and authorization framework for TypeScript. It provides a comprehensive set of features out of the box and includes a plugin ecosystem that simplifies adding advanced functionalities. **lets do it.** someone here.

---

## Quick Start

Get up and running in under 5 minutes:

```bash title="terminal"
npm install better-auth
npm install demo - hello world
```

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

export const auth = betterAuth({
database: {
provider: "postgresql",
provider: "psg",
url: process.env.DATABASE_URL,
},
emailAndPassword: {
Expand All @@ -57,8 +47,38 @@ export const auth = betterAuth({

---

## Next Steps
## Next Steps:

- Read the [Installation](/docs/installation) guide
- Follow the [Get Started](/docs/getting-started) guide
- Explore [Concepts](/docs/concepts)

<HoverLink href="/docs" title="Related guide" description="A useful related documentation page.">
Read the related guide
</HoverLink>

<Prompt title="Try this prompt">
Use this docs page to implement the feature.
</Prompt>

<Callout type="note" title="hello world">
Write a helpful callout.
</Callout>

<Tabs items={["npm", "pnpm", "drag.ts"]}>
<Tab value="npm">
```bash
npm install my-package
```
</Tab>

<Tab value="pnpm">
```bash
pnpm add my-package
```
</Tab>

<Tab value="drag.ts">
Content
</Tab>
</Tabs>
1 change: 1 addition & 0 deletions examples/next/docs.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const searchConfig: DocsSearchConfig | undefined =

export default defineDocs({
entry: "docs",
devTools: true,
...(searchConfig ? { search: searchConfig } : {}),
observability: {
console: "debug",
Expand Down
1 change: 1 addition & 0 deletions packages/docs/src/define-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export function defineDocs(config: DocsConfig): DocsConfig {
ai: config.ai,
ordering: config.ordering,
metadata: config.metadata,
devTools: config.devTools,
og: config.og,
changelog: config.changelog,
apiReference: config.apiReference,
Expand Down
1 change: 1 addition & 0 deletions packages/docs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export type {
DocsNav,
DocsTheme,
DocsMetadata,
DevToolsConfig,
OGConfig,
OpenGraphImage,
PageOpenGraph,
Expand Down
20 changes: 20 additions & 0 deletions packages/docs/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,19 @@ export interface DocsMetadata {
twitterCard?: "summary" | "summary_large_image";
}

export interface DevToolsConfig {
/**
* Enables the built-in visual docs editor in development.
*
* When enabled, the docs UI renders a floating action button that can edit
* the current MDX page and apply changes back to the source file through the
* local docs API.
*
* @default false
*/
enabled?: boolean;
}

export interface OGConfig {
enabled?: boolean;
type?: "static" | "dynamic";
Expand Down Expand Up @@ -2618,6 +2631,13 @@ export interface DocsConfig {
agent?: DocsAgentConfig;
/** SEO metadata - separate from theme */
metadata?: DocsMetadata;
/**
* Built-in visual docs editor.
*
* Use `devTools: true` during local development to edit MDX pages with the
* floating docs editor and write changes back to the page source file.
*/
devTools?: boolean | DevToolsConfig;
/** Open Graph image handling */
og?: OGConfig;
}
1 change: 0 additions & 1 deletion packages/fumadocs/src/colorful/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const ColorfulUIDefaults = {
Callout: { variant: "soft", icon: true },
CodeBlock: { showCopyButton: true },
HoverLink: { linkLabel: "Open page", showIndicator: false },
Tabs: { style: "default" },
},
};

Expand Down
1 change: 0 additions & 1 deletion packages/fumadocs/src/command-grid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const CommandGridUIDefaults = {
Callout: { variant: "soft", icon: true },
CodeBlock: { showCopyButton: true },
HoverLink: { linkLabel: "Open page", showIndicator: false },
Tabs: { style: "default" as const },
},
};

Expand Down
1 change: 0 additions & 1 deletion packages/fumadocs/src/concrete/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const ConcreteUIDefaults = {
Callout: { variant: "outline", icon: true },
CodeBlock: { showCopyButton: true },
HoverLink: { linkLabel: "View doc", showIndicator: false },
Tabs: { style: "default" as const },
},
};

Expand Down
1 change: 0 additions & 1 deletion packages/fumadocs/src/darkbold/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const DarkBoldUIDefaults = {
Callout: { variant: "soft", icon: true },
CodeBlock: { showCopyButton: true },
HoverLink: { linkLabel: "Open page", showIndicator: false },
Tabs: { style: "default" },
},
};

Expand Down
1 change: 0 additions & 1 deletion packages/fumadocs/src/darksharp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const DarksharpUIDefaults = {
Callout: { variant: "soft", icon: true },
CodeBlock: { showCopyButton: true },
HoverLink: { linkLabel: "Open page", showIndicator: false },
Tabs: { style: "default" },
},
};

Expand Down
1 change: 0 additions & 1 deletion packages/fumadocs/src/default/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ const DefaultUIDefaults = {
Callout: { variant: "soft", icon: true },
CodeBlock: { showCopyButton: true },
HoverLink: { linkLabel: "Open page", showIndicator: false },
Tabs: { style: "default" },
},
};

Expand Down
Loading
Loading