Skip to content

Commit 634a9a7

Browse files
committed
final tweaks
1 parent 631fd77 commit 634a9a7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/guides/frameworks/nango.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ sequenceDiagram
6666
npm install @nangohq/frontend
6767
```
6868

69-
The frontend SDK requires a short-lived **connect session token** issued by your backend — this replaces the old public key approach. Add an API route that creates the session:
69+
The frontend SDK requires a short-lived **connect session token** issued by your backend. Add an API route that creates the session:
7070

7171
```ts app/api/nango-session/route.ts
7272
import { NextResponse } from "next/server";
@@ -85,6 +85,12 @@ sequenceDiagram
8585
}),
8686
});
8787

88+
if (!response.ok) {
89+
const text = await response.text();
90+
console.error("Nango error:", response.status, text);
91+
return NextResponse.json({ error: text }, { status: response.status });
92+
}
93+
8894
const { data } = await response.json();
8995
return NextResponse.json({ token: data.token });
9096
}
@@ -125,10 +131,6 @@ sequenceDiagram
125131
}
126132
```
127133

128-
<Note>
129-
The session token expires after 30 minutes and is used only to open the OAuth popup — it is not stored. The `connectionId` returned by `nango.auth()` is the stable identifier you pass to future task runs to retrieve the user's access token.
130-
</Note>
131-
132134
</Step>
133135
</Steps>
134136

@@ -242,7 +244,7 @@ export async function POST(req: Request) {
242244

243245
## Step 4: Set environment variables
244246

245-
Add the following to your `.env` file. Trigger.dev dev mode reads from `.env`, not `.env.local`, so keep task-related secrets there:
247+
Add the following to your `.env.local` file:
246248

247249
```bash
248250
NANGO_SECRET_KEY= # From Nango dashboard → Environment → Secret key

0 commit comments

Comments
 (0)