diff --git a/docs/app/docs/[[...slug]]/page.tsx b/docs/app/docs/[[...slug]]/page.tsx index 5bca9cb5..b6528e84 100644 --- a/docs/app/docs/[[...slug]]/page.tsx +++ b/docs/app/docs/[[...slug]]/page.tsx @@ -13,6 +13,9 @@ import { Features } from "@/components/blocks/features"; import { ForkButton } from "@/components/fork-button"; import Link from "next/link"; import defaultMdxComponents from "fumadocs-ui/mdx"; +import { createTypeTable } from "fumadocs-typescript/ui"; + +const { AutoTypeTable } = createTypeTable(); export default async function Page({ params, @@ -65,6 +68,7 @@ export default async function Page({ Steps, Tab, Tabs, + AutoTypeTable, GenerateSecret, AnimatePresence, TypeTable, diff --git a/docs/components/infinite-scrolling.tsx b/docs/components/infinite-scrolling.tsx index 2f26772f..148fa85f 100644 --- a/docs/components/infinite-scrolling.tsx +++ b/docs/components/infinite-scrolling.tsx @@ -105,7 +105,7 @@ export const InfiniteMovingCards = ({ Promise', - }, - resetPasswordTokenExpiresIn: { - description: "Expiration time for the reset password token. The value should be in seconds.", - type: 'number', - default: 60 * 60 * 1 // 1 hour - }, - sendVerificationEmail: { - description: "Send verification email to user's email. It takes email and data that contains `url` and `token` props.", - type: `(email: string, data: Data) => Promise` - }, - sendEmailVerificationOnSignUp: { - description: "Trigger email verification on sign up. If set to true, `sendVerificationEmail` function must be provided.", - type: 'boolean', - default: false - }, - password: { - description: "Custom password hashing function. ", - type: `{ - hash: Function, - verify: Function - }`, - default: "scrypt" - } - }} -/> - -### `socialProviders` - -a configuration object that contains the configuration for social providers. - -```ts title="auth.ts" -const auth = betterAuth({ - socialProviders: { - google: { - clientId: process.env.GOOGLE_CLIENT_ID as string, - clientSecret: process.env.GOOGLE_CLIENT_SECRET as string, - }, - github: { - clientId: process.env.GITHUB_CLIENT_ID as string, - clientSecret: process.env.GITHUB_CLIENT_SECRET as string, - } - } -}) -``` - -### `plugins` - -`Plugin[]` - List of plugins to use with Better Auth. - -### `user` - -`UserOptions` - User configuration options. - - - -### `session` - -`SessionOptions` - Session configuration options. - - - -### `account` - -`AccountOptions` - Account configuration options. - - - -#### `accountLinking` - -`AccountLinkingOptions` - Account linking configuration options. - - - -### `rateLimit` - -`RateLimitOptions` - Rate limiting configuration options. - -" - }, - storage: { - description: "Storage for rate limiting data.", - type: "'memory' | 'database'", - default: 'memory' - }, - tableName: { - description: "Name of the table to store rate limiting data. Applied when `storage` is set to `database`.", - type: 'string', - default: 'rateLimit' - }, - customStorage: { - description: "Custom storage for rate limiting data.", - type: 'RateLimitStorage' - } - }} -/> - -### `trustedOrigins` - -list of trusted origins. This is very important to prevent CSRF attacks and open redirects. - -```ts title="auth.ts" -const auth = betterAuth({ - trustedOrigins: [ - 'https://example.com', - 'https://app.example.com' - ] -}) -``` - -### `advanced` - -`AdvancedOptions` - Advanced configuration options. - - - - - -### `onAPIError` - -`OnAPIErrorOptions` - Options for handling API errors. - - void' - } - }} -/> - -### `logger` - -`LoggerOptions` - Logger configuration options. - - + \ No newline at end of file diff --git a/docs/lib/auth.ts b/docs/lib/auth.ts new file mode 100644 index 00000000..64bb44ed --- /dev/null +++ b/docs/lib/auth.ts @@ -0,0 +1,3 @@ +import { BetterAuthOptions } from "better-auth"; + +export { type BetterAuthOptions }; diff --git a/docs/package.json b/docs/package.json index 48d081d2..fa48c0c0 100644 --- a/docs/package.json +++ b/docs/package.json @@ -60,7 +60,7 @@ "fumadocs-docgen": "^1.1.0", "fumadocs-mdx": "11.1.0", "fumadocs-twoslash": "^1.1.2", - "fumadocs-typescript": "^2.1.0", + "fumadocs-typescript": "^3.0.2", "fumadocs-ui": "14.0.2", "geist": "^1.3.1", "input-otp": "^1.2.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 10bffd6d..ddbee34b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -476,8 +476,8 @@ importers: specifier: ^1.1.2 version: 1.1.3(fumadocs-ui@14.0.2(@types/react-dom@18.3.1)(@types/react@18.3.12)(next@15.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(shiki@1.22.2)(typescript@5.6.3) fumadocs-typescript: - specifier: ^2.1.0 - version: 2.1.0(typescript@5.6.3) + specifier: ^3.0.2 + version: 3.0.2(typescript@5.6.3) fumadocs-ui: specifier: 14.0.2 version: 14.0.2(@types/react-dom@18.3.1)(@types/react@18.3.12)(next@15.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -10309,11 +10309,6 @@ packages: fumadocs-ui: 13.x.x shiki: 1.x.x - fumadocs-typescript@2.1.0: - resolution: {integrity: sha512-fxxC8F+bQQxlVQA03vWaoztJFeKkevW3WgT7ECPCmdOB2UFsRB61cgzlRvwKqtFWJuJYASX55+2wEMxXAjzBjQ==} - peerDependencies: - typescript: '*' - fumadocs-typescript@3.0.2: resolution: {integrity: sha512-SqYJy+NxjjuQQeom7wLpODYiWtIKWfndguHL3XKXaMUvhlsjmsWWTaXJWKaqIfOStiYJQlGWrXxFA2Rrpbx63Q==} peerDependencies: @@ -28196,17 +28191,6 @@ snapshots: - supports-color - typescript - fumadocs-typescript@2.1.0(typescript@5.6.3): - dependencies: - fast-glob: 3.3.2 - hast-util-to-jsx-runtime: 2.3.2 - mdast-util-from-markdown: 2.0.2 - mdast-util-gfm: 3.0.0 - mdast-util-to-hast: 13.2.0 - typescript: 5.6.3 - transitivePeerDependencies: - - supports-color - fumadocs-typescript@3.0.2(typescript@5.6.3): dependencies: '@types/node': 22.8.1