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
Workers access Flagship through the `env.FLAGS`binding. The binding provides type-safe methods for evaluating feature flags. If an evaluation fails or a flag is not found, the method returns the default value you provide.
10
+
Workers access Flagship through a binding that you add to your Wrangler configuration file. The `binding` field sets the variable name you use in your Worker code.
11
11
12
-
To add the binding, configure your Wrangler file and run `npx wrangler types` to generate TypeScript types. Refer to [Get started](/flagship/get-started/) for setup instructions.
12
+
<WranglerConfig>
13
+
14
+
```jsonc
15
+
{
16
+
"flagship": {
17
+
"binding":"FLAGS",
18
+
"app_id":"<APP_ID>",
19
+
},
20
+
}
21
+
```
22
+
23
+
</WranglerConfig>
24
+
25
+
Replace `<APP_ID>` with the app ID from the [Cloudflare dashboard](https://dash.cloudflare.com). With this configuration, the binding is available as `env.FLAGS`. Refer to [Configuration](/flagship/configuration/) for additional options such as binding to multiple apps.
26
+
27
+
The binding provides type-safe methods for evaluating feature flags. If an evaluation fails or a flag is not found, the method returns the default value you provide.
0 commit comments