Skip to content

Commit d89cf2c

Browse files
Replace create secrets examples with APIRequest version
1 parent 266d6ce commit d89cf2c

File tree

2 files changed

+38
-40
lines changed

2 files changed

+38
-40
lines changed

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

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

9-
import { WranglerConfig, Tabs, TabItem } from "~/components";
9+
import { WranglerConfig, Tabs, TabItem, APIRequest } from "~/components";
1010

1111
[Cloudflare Secrets Store](/secrets-store/) is a secure, centralized location in which account-level secrets are stored and managed. The secrets are securely encrypted and stored across all Cloudflare data centers.
1212

@@ -68,25 +68,24 @@ You can find and copy the store ID from the [Secrets Store tab](https://dash.clo
6868

6969
Refer to [Secrets Store API](/api/resources/secrets_store/) for the full API documentation.
7070

71-
```bash
72-
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/secrets_store/stores/$STORE_ID/secrets \
73-
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
74-
--header "Content-Type: application/json" \
75-
--data '[
76-
{
77-
"name":"<MY_SECRET_NAME>",
78-
"value":"<SECRET_VALUE>",
79-
"scopes":["workers"],
80-
"comment":""
81-
},
82-
{
83-
"name":"<MY_SECRET_NAME_2>",
84-
"value":"<SECRET_VALUE>",
85-
"scopes":["workers"],
86-
"comment":""
87-
}
88-
]'
89-
```
71+
<APIRequest
72+
path="/accounts/{account_id}/secrets_store/stores/{store_id}/secrets"
73+
method="POST"
74+
json={[
75+
{
76+
"name":"<MY_SECRET_NAME>",
77+
"value":"<SECRET_VALUE>",
78+
"scopes":["workers"],
79+
"comment":""
80+
},
81+
{
82+
"name":"<MY_SECRET_NAME_2>",
83+
"value":"<SECRET_VALUE>",
84+
"scopes":["workers"],
85+
"comment":""
86+
}
87+
]}
88+
/>
9089

9190
</TabItem> </Tabs>
9291

src/content/docs/secrets-store/manage-secrets/how-to.mdx

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 2
66
---
77

8-
import { Tabs, TabItem } from "~/components";
8+
import { Tabs, TabItem, APIRequest } from "~/components";
99

1010
Refer to the sections below to learn about common actions you might want to take when managing your data in Secrets Store.
1111

@@ -31,25 +31,24 @@ You must have a [Super Administrator or Secrets Store Admin role](/secrets-store
3131
A secret `name` cannot contain spaces. Refer to [Secrets Store API](/api/resources/secrets_store/) for the full API documentation.
3232
:::
3333

34-
```bash
35-
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/secrets_store/stores/$STORE_ID/secrets \
36-
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
37-
--header "Content-Type: application/json" \
38-
--data '[
39-
{
40-
"name":"<MY_SECRET_NAME>",
41-
"value":"<SECRET_VALUE>",
42-
"scopes":["workers"],
43-
"comment":""
44-
},
45-
{
46-
"name":"<MY_SECRET_NAME_2>",
47-
"value":"<SECRET_VALUE>",
48-
"scopes":["workers"],
49-
"comment":""
50-
}
51-
]'
52-
```
34+
<APIRequest
35+
path="/accounts/{account_id}/secrets_store/stores/{store_id}/secrets"
36+
method="POST"
37+
json={[
38+
{
39+
"name":"<MY_SECRET_NAME>",
40+
"value":"<SECRET_VALUE>",
41+
"scopes":["workers"],
42+
"comment":""
43+
},
44+
{
45+
"name":"<MY_SECRET_NAME_2>",
46+
"value":"<SECRET_VALUE>",
47+
"scopes":["workers"],
48+
"comment":""
49+
}
50+
]}
51+
/>
5352

5453
</TabItem> </Tabs>
5554

0 commit comments

Comments
 (0)