mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
docs: Make explicit that you have to create lib/stack.ts
This commit is contained in:
parent
2c68b86c90
commit
aba1227808
@ -28,7 +28,7 @@ npm install @stackframe/stack
|
||||
STACK_SECRET_SERVER_KEY=<your-secret-server-key>
|
||||
```
|
||||
|
||||
2. Create `StackServerApp` in `@lib/stack.ts`:
|
||||
2. Create a new file in `lib/stack.ts` and fill it with the following:
|
||||
|
||||
```tsx
|
||||
import "server-only";
|
||||
|
||||
@ -34,7 +34,7 @@ On Server Components, you don't need `useStackApp()`. Instead, you can just impo
|
||||
|
||||
```tsx
|
||||
import "server-only";
|
||||
import { stackApp } from "lib/stack";
|
||||
import { stackApp } from "@/lib/stack";
|
||||
|
||||
export default async function MyComponent() {
|
||||
const user = await stackApp.getUser();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user