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: docs-v2/pages/connect/api.mdx
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,6 +102,36 @@ export default function Home() {
102
102
}
103
103
```
104
104
105
+
## Environment
106
+
107
+
Some API endpoints accept an [environment](/connect/environments) parameter. This lets you specify the environment (`production` or `development`) where resources will live in your project.
108
+
109
+
You can set the environment when you create the SDK client:
environment: "development", // change to production if running for a test production account, or in production
116
+
credentials: {
117
+
clientId: "your-oauth-client-id",
118
+
clientSecret: "your-oauth-client-secret",
119
+
}
120
+
});
121
+
```
122
+
123
+
or pass the `X-PD-Environment` header in HTTP requests:
124
+
125
+
```bash
126
+
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/tokens \
127
+
-H "Content-Type: application/json" \
128
+
-H "X-PD-Environment: development" \
129
+
-H "Authorization: Bearer {access_token}" \
130
+
-d '{
131
+
"external_user_id": "your-external-user-id"
132
+
}'
133
+
```
134
+
105
135
## External users
106
136
107
137
When you use the Connect API, you'll pass an `external_user_id` parameter when initiating account connections and retrieving credentials. This is your user's ID, in your system — whatever you use to uniquely identify them.
@@ -245,6 +275,7 @@ import {
245
275
} from"@pipedream/sdk";
246
276
247
277
const pd =createBackendClient({
278
+
environment: "development", // change to production if running for a test production account, or in production
Copy file name to clipboardExpand all lines: docs-v2/pages/connect/environments.mdx
+27-1Lines changed: 27 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,4 +7,30 @@ Pipedream Connect projects support two environments: `development` and `producti
7
7
8
8
## How to specify environment
9
9
10
-
You specify the environment when [creating a new Connect token](/connect/api/#create-a-new-token) with the Pipedream SDK or API. By default, the enviromment is set to `production`. When users succesfully connect their account, Pipedream saves it for that `external_user_id` in the specified `environment_name`.
10
+
You specify the environment when [creating a new Connect token](/connect/api/#create-a-new-token) with the Pipedream SDK or API. By default, the enviromment is set to `production`. When users succesfully connect their account, Pipedream saves it for that `external_user_id` in the specified environment.
11
+
12
+
You can set the environment when you create the SDK client:
0 commit comments