mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 12:27:44 +00:00
SvelteKit, Next.js, SolidStart
This commit is contained in:
@@ -1811,7 +1811,7 @@ export const examples: Content[] = [
|
|||||||
icon: Icons.remix,
|
icon: Icons.remix,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Next JS",
|
title: "Next.js",
|
||||||
href: "/docs/examples/next-js",
|
href: "/docs/examples/next-js",
|
||||||
icon: Icons.nextJS,
|
icon: Icons.nextJS,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -296,8 +296,8 @@ The server provides a `session` object that you can use to access the session da
|
|||||||
|
|
||||||
**Example: Using some popular frameworks**
|
**Example: Using some popular frameworks**
|
||||||
|
|
||||||
<Tabs items={["NextJs", "Nuxt", "Svelte", "Astro", "Hono", "TanStack"]}>
|
<Tabs items={["Next.js", "Nuxt", "Svelte", "Astro", "Hono", "TanStack"]}>
|
||||||
<Tab value="NextJs">
|
<Tab value="Next.js">
|
||||||
```ts title="server.ts"
|
```ts title="server.ts"
|
||||||
import { auth } from "./auth"; // path to your Better Auth server instance
|
import { auth } from "./auth"; // path to your Better Auth server instance
|
||||||
import { headers } from "next/headers";
|
import { headers } from "next/headers";
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ See [Demo](https://demo.better-auth.com)
|
|||||||
borderRadius: "4px",
|
borderRadius: "4px",
|
||||||
overflow: "hidden"
|
overflow: "hidden"
|
||||||
}}
|
}}
|
||||||
title="Better Auth Next Js Example"
|
title="Better Auth Next.js Example"
|
||||||
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
|
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
|
||||||
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ Read more about [cookie caching](/docs/concepts/session-management#cookie-cache)
|
|||||||
|
|
||||||
Here are examples of how you can do caching in different frameworks and environments:
|
Here are examples of how you can do caching in different frameworks and environments:
|
||||||
|
|
||||||
<Tabs items={["NextJs", "Remix", "Solid Start", "React Query"]}>
|
<Tabs items={["Next.js", "Remix", "SolidStart", "React Query"]}>
|
||||||
<Tab value="NextJS">
|
<Tab value="NextJS">
|
||||||
Since Next v15, we can use the `"use cache"` directive to cache the response of a server function.
|
Since Next v15, we can use the `"use cache"` directive to cache the response of a server function.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user