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
Copy file name to clipboardExpand all lines: skills/flags-sdk/SKILL.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,8 @@ Check the project state to decide which steps you can skip:
71
71
- Does `.vercel/` directory exist? → Project is linked, skip `vercel link` in step 2
72
72
- Does `.env.local` contain `FLAGS=`? → Env vars already pulled, skip step 3
73
73
- Does `flags.ts` (or `lib/flags.ts`, `src/flags.ts`) exist? → Add to it rather than creating from scratch (step 4)
74
-
- Does `app/.well-known/vercel/flags/route.ts` exist? → Flags Explorer already set up, skip step 6
74
+
- Is `@vercel/toolbar` in `package.json`? → Skip toolbar setup (step 6)
75
+
- Does `app/.well-known/vercel/flags/route.ts` exist? → Flags Explorer already set up, skip step 7
75
76
76
77
### Steps
77
78
@@ -109,7 +110,13 @@ Check the project state to decide which steps you can skip:
109
110
}
110
111
```
111
112
112
-
6.**Set up Flags Explorer** (if not already present): Create `app/.well-known/vercel/flags/route.ts` — see the [Flags Explorer setup](#flags-explorer-setup) section below.
113
+
6.**Set up the Vercel Toolbar** (if not already present):
114
+
- Run `pnpm i @vercel/toolbar`
115
+
- Wrap `next.config.ts` with the toolbar plugin
116
+
- Render `<VercelToolbar />` in the root layout
117
+
See [references/nextjs.md — Toolbar Setup](references/nextjs.md#toolbar-setup) for the full code.
118
+
119
+
7.**Set up Flags Explorer** (if not already present): Create `app/.well-known/vercel/flags/route.ts` — see the [Flags Explorer setup](#flags-explorer-setup) section below.
Call the flag function from any async server component or proxy:
@@ -432,6 +479,8 @@ The `hasAuthCookieFlag` checks cookie existence without authenticating. Two shel
432
479
433
480
## Flags Explorer (Next.js)
434
481
482
+
The Flags Explorer is part of the Vercel Toolbar. Before adding the discovery endpoint below, make sure the toolbar is set up by following the [Toolbar Setup](#toolbar-setup) steps first.
0 commit comments