You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**DO NOT CONTINUE TO STEP 4 UNTIL USER ADDS THEIR KEYS**
41
77
78
+
Show this exact message (verbatim), then **STOP AND WAIT**:
79
+
80
+
**For Next.js Projects:**
42
81
```
43
82
=== ACTION REQUIRED ===
44
83
TODO in your web browser:
45
84
1) Open: https://app.stack-auth.com (→ your project dashboard)
46
85
2) Create a new project
47
-
3) Copy these keys:
86
+
3) Choose your framework: Next.js
87
+
4) Copy these keys:
48
88
- NEXT_PUBLIC_STACK_PROJECT_ID=...
49
89
- NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY=...
50
90
- STACK_SECRET_SERVER_KEY=...
51
-
4) Paste them into your local `.env.local` (do not commit this file).
52
-
5) Save the file.
91
+
5) Paste them into your local `.env.local` (do not commit this file).
92
+
6) Save the file.
93
+
94
+
Reply here when done:
95
+
- Type **y** to continue
96
+
- Type **n** to cancel
97
+
```
98
+
99
+
**For React Projects:**
100
+
```
101
+
=== ACTION REQUIRED ===
102
+
TODO in your web browser:
103
+
1) Open: https://app.stack-auth.com (→ your project dashboard)
104
+
2) Create a new project
105
+
3) Choose your framework: React
106
+
4) Copy these keys:
107
+
- Project ID
108
+
- Publishable Client Key
109
+
5) Update the `stack/client.ts` file with your keys:
110
+
- Replace "YOUR_PROJECT_ID_HERE" with your Project ID
111
+
- Replace "YOUR_PUBLISHABLE_CLIENT_KEY_HERE" with your Publishable Client Key
112
+
6) Save the file.
53
113
54
114
Reply here when done:
55
115
- Type **y** to continue
@@ -59,13 +119,48 @@ Reply here when done:
59
119
If user replies `n`: Stop and summarize what remains.
60
120
61
121
If user replies `y`:
62
-
- If dev server is running, stop it.
63
-
- Start it again so Next.js reloads env vars.
64
-
- Proceed to Verification.
122
+
- Proceed
65
123
66
124
### 4) Wrap the App
125
+
126
+
#### For Next.js Projects:
67
127
Ensure the StackProvider from `src/stack.tsx` is wired into `src/app/layout.tsx`.
68
128
129
+
#### For React Projects:
130
+
Update your App.tsx file (or equivalent if the user changed the naming) to wrap the entire app with a StackProvider and StackTheme and add a StackHandler component to handle the authentication flow.
131
+
132
+
```typescript
133
+
import { StackHandler, StackProvider, StackTheme } from "@stackframe/react";
134
+
import { Suspense } from "react";
135
+
import { BrowserRouter, Route, Routes, useLocation } from "react-router-dom";
**DO NOT CONTINUE TO STEP 4 UNTIL USER ADDS THEIR KEYS**
41
77
78
+
Show this exact message (verbatim), then **STOP AND WAIT**:
79
+
80
+
**For Next.js Projects:**
42
81
```
43
82
=== ACTION REQUIRED ===
44
83
TODO in your web browser:
45
84
1) Open: https://app.stack-auth.com (→ your project dashboard)
46
85
2) Create a new project
47
-
3) Copy these keys:
86
+
3) Choose your framework: Next.js
87
+
4) Copy these keys:
48
88
- NEXT_PUBLIC_STACK_PROJECT_ID=...
49
89
- NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY=...
50
90
- STACK_SECRET_SERVER_KEY=...
51
-
4) Paste them into your local `.env.local` (do not commit this file).
52
-
5) Save the file.
91
+
5) Paste them into your local `.env.local` (do not commit this file).
92
+
6) Save the file.
93
+
94
+
Reply here when done:
95
+
- Type **y** to continue
96
+
- Type **n** to cancel
97
+
```
98
+
99
+
**For React Projects:**
100
+
```
101
+
=== ACTION REQUIRED ===
102
+
TODO in your web browser:
103
+
1) Open: https://app.stack-auth.com (→ your project dashboard)
104
+
2) Create a new project
105
+
3) Choose your framework: React
106
+
4) Copy these keys:
107
+
- Project ID
108
+
- Publishable Client Key
109
+
5) Update the `stack/client.ts` file with your keys:
110
+
- Replace "YOUR_PROJECT_ID_HERE" with your Project ID
111
+
- Replace "YOUR_PUBLISHABLE_CLIENT_KEY_HERE" with your Publishable Client Key
112
+
6) Save the file.
53
113
54
114
Reply here when done:
55
115
- Type **y** to continue
@@ -59,13 +119,48 @@ Reply here when done:
59
119
If user replies `n`: Stop and summarize what remains.
60
120
61
121
If user replies `y`:
62
-
- If dev server is running, stop it.
63
-
- Start it again so Next.js reloads env vars.
64
-
- Proceed to Verification.
122
+
- Proceed
65
123
66
124
### 4) Wrap the App
125
+
126
+
#### For Next.js Projects:
67
127
Ensure the StackProvider from `src/stack.tsx` is wired into `src/app/layout.tsx`.
68
128
129
+
#### For React Projects:
130
+
Update your App.tsx file (or equivalent if the user changed the naming) to wrap the entire app with a StackProvider and StackTheme and add a StackHandler component to handle the authentication flow.
131
+
132
+
```typescript
133
+
import { StackHandler, StackProvider, StackTheme } from "@stackframe/react";
134
+
import { Suspense } from "react";
135
+
import { BrowserRouter, Route, Routes, useLocation } from "react-router-dom";
0 commit comments