Skip to content

Commit 6fe4153

Browse files
Add instructions and cross-links to bindings in config files
1 parent 9eaee0a commit 6fe4153

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/content/docs/secrets-store/integrations/workers.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ sidebar:
66
label: Use with Workers
77
---
88

9+
import { WranglerConfig } from "~/components";
10+
911
Consider the steps below to learn how to use values from your account [Secrets Store](/secrets-store/) with [Cloudflare Workers](/workers/).
1012

1113
:::note
@@ -34,13 +36,33 @@ Refer to [manage account secrets](/secrets-store/manage-secrets/) for further op
3436

3537
## 2. Bind an account secret to your Worker
3638

39+
[Bindings](/workers/runtime-apis/bindings/) allow your Worker to interact with resources on your Cloudflare account.
40+
3741
(TBC) You must have one of the following [roles within your Cloudflare account](/secrets-store/access-control/):
3842
- Super Administrator
3943
- Secrets Store Admin
4044
- Secrets Store Deploy
4145

4246
### Option A: via Wrangler
4347

48+
(TBC)
49+
1. Add a Secrets Store binding to your [Wrangler configuration file](/workers/wrangler/configuration/):
50+
- `binding`: a descriptive name for your binding. This will be used in the Workers application when [accessing your secret on the `env` object](/secrets-store/integrations/workers/#3-access-the-secret-on-the-env-object).
51+
- `store_id`: the corresponding Secrets Store ID where your account secret was created.
52+
- `secret_name`: the unique secret name, defined when your account secret was created.
53+
54+
<WranglerConfig>
55+
56+
```toml
57+
main = "./src/index.js"
58+
secrets_store_secret = [
59+
{ binding = "MY_SECRETS_STORE_SECRET", store_id= '<STORE_ID>', secret_name = "<MY_SECRET_NAME>" }
60+
]
61+
```
62+
63+
</WranglerConfig>
64+
65+
4466
### Option B: via Dashboard
4567

4668
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account.

0 commit comments

Comments
 (0)