Skip to content

Commit 224943d

Browse files
Adding allowed_origins to createConnectToken docs
1 parent 089a023 commit 224943d

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

docs-v2/pages/connect/api.mdx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,17 @@ The ID of your end user. Use whatever ID uniquely identifies the user in your sy
181181

182182
---
183183

184+
`allowed_origins` **string array**
185+
186+
When using the Connect API to make requests from a client environment like a browser, you must specify the allowed origins for the token. Otherwise, this field is optional. This is a list of URLs that are allowed to make requests with the token. For example:
187+
188+
```json
189+
{
190+
"allowed_origins": ["http://localhost:3000", "https://example.com"]
191+
}
192+
```
193+
---
194+
184195
`success_redirect_uri` **string** (_optional_)
185196

186197
When using [Connect Link](/connect/connect-link), you can optionally redirect your end user to the `success_redirect_uri` on successful completion of the auth flow.
@@ -224,6 +235,7 @@ const pd = createBackendClient({
224235

225236
const { token, expires_at } = await pd.createConnectToken({
226237
external_user_id: "{your_external_user_id}" // The end user's ID in your system
238+
allowed_origins: ["http://localhost:3000", "https://example.com"], // The allowed origins for the token (required for client-side requests)
227239
});
228240
```
229241
</Tabs.Tab>
@@ -242,6 +254,7 @@ const pd = createBackendClient({
242254

243255
const { token, expires_at } = await pd.createConnectToken({
244256
external_user_id: "{your_external_user_id}", // The end user's ID in your system
257+
allowed_origins: ["http://localhost:3000", "https://example.com"], // The allowed origins for the token (required for client-side requests)
245258
});
246259
```
247260
</Tabs.Tab>
@@ -263,7 +276,11 @@ curl -X POST https://api.pipedream.com/v1/connect/{project_id}/tokens \
263276
-H "X-PD-Environment: development" \
264277
-H "Authorization: Bearer {access_token}" \
265278
-d '{
266-
"external_user_id": "{your_external_user_id}"
279+
"external_user_id": "{your_external_user_id}",
280+
"allowed_origins": [
281+
"http://localhost:3000",
282+
"https://example.com"
283+
],
267284
}'
268285
```
269286
</Tabs.Tab>

docs-v2/pages/connect/workflows.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,7 @@ curl -X POST https://{your-endpoint-url} \
232232
</div>
233233

234234
<Callout type="info">
235-
We plan to improve this interface in the future, and potentially allow developers to store end user metadata and configuration data alongside the connected account for your end users, so you won't need to pass the data at runtime.
236-
237-
[Let us know](https://pipedream.com/support) if that's a feature you'd like to see.
235+
We plan to improve this interface in the future, and potentially allow developers to store end user metadata and configuration data alongside the connected account for your end users, so you won't need to pass the data at runtime. [Let us know](https://pipedream.com/support) if that's a feature you'd like to see.
238236
</Callout>
239237

240238
## Testing workflow steps

0 commit comments

Comments
 (0)