Skip to content

Commit 28920a2

Browse files
committed
Fixing @pipedream/sdk imports
1 parent 40100d9 commit 28920a2

File tree

7 files changed

+32
-32
lines changed

7 files changed

+32
-32
lines changed

docs-v2/pages/connect/api.mdx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You can also load the client-side SDK via `<script>` tag. You can run the latest
3636
or a specific version:
3737

3838
```html
39-
<script src="https://unpkg.com/@pipedream/sdk@0.0.13/dist/browser/index.js"></script>
39+
<script src="https://unpkg.com/@pipedream/sdk@1.0.6/dist/browser/index.js"></script>
4040
```
4141

4242
## Authentication
@@ -50,7 +50,7 @@ Most of your interactions with the Connect API will happen on the server, to pro
5050
[Create a Pipedream OAuth client](/rest-api/auth#oauth) and instantiate the SDK with your client ID and secret:
5151

5252
```typescript
53-
import { createBackendClient } from "@pipedream/sdk";
53+
import { createBackendClient } from "@pipedream/sdk/server";
5454

5555
// These secrets should be saved securely and passed to your environment
5656
const pd = createBackendClient({
@@ -73,7 +73,7 @@ You'll primarily use the browser SDK to let your users securely connect apps fro
7373
Here's a Next.js example [from our quickstart](/connect/quickstart):
7474

7575
```typescript
76-
import { createFrontendClient } from "@pipedream/sdk"
76+
import { createFrontendClient } from "@pipedream/sdk/browser"
7777
// Example from our Next.js app
7878
import { serverConnectTokenCreate } from "./server"
7979

@@ -109,7 +109,7 @@ Some API endpoints accept an [environment](/connect/environments) parameter. Thi
109109
Always set the environment when you create the SDK client:
110110

111111
```typescript
112-
import { createBackendClient } from "@pipedream/sdk";
112+
import { createBackendClient } from "@pipedream/sdk/server";
113113

114114
const pd = createBackendClient({
115115
environment: "development", // change to production if running for a test production account, or in production
@@ -211,7 +211,7 @@ import {
211211
type ConnectAPIResponse,
212212
type ConnectTokenCreateOpts,
213213
type ConnectTokenResponse,
214-
} from "@pipedream/sdk";
214+
} from "@pipedream/sdk/server";
215215

216216
const pd = createBackendClient({
217217
environment: "development", // change to production if running for a test production account, or in production
@@ -230,7 +230,7 @@ const { token, expires_at } = await pd.createConnectToken({
230230
</Tabs.Tab>
231231
<Tabs.Tab>
232232
```javascript
233-
import { createBackendClient } from "@pipedream/sdk";
233+
import { createBackendClient } from "@pipedream/sdk/server";
234234

235235
const pd = createBackendClient({
236236
environment: "development", // change to production if running for a test production account, or in production
@@ -320,7 +320,7 @@ Pass `include_credentials=true` as a query-string parameter to include the accou
320320
```typescript
321321
import {
322322
createBackendClient,
323-
} from "@pipedream/sdk";
323+
} from "@pipedream/sdk/server";
324324

325325
const pd = createBackendClient({
326326
environment: "development", // change to production if running for a test production account, or in production
@@ -341,7 +341,7 @@ const accounts = await pd.getAccounts({
341341
</Tabs.Tab>
342342
<Tabs.Tab>
343343
```javascript
344-
import { createBackendClient } from "@pipedream/sdk";
344+
import { createBackendClient } from "@pipedream/sdk/server";
345345

346346
const pd = createBackendClient({
347347
environment: "development", // change to production if running for a test production account, or in production
@@ -488,7 +488,7 @@ Pass `include_credentials=true` as a query-string parameter to include the accou
488488
```typescript
489489
import {
490490
createBackendClient,
491-
} from "@pipedream/sdk";
491+
} from "@pipedream/sdk/server";
492492

493493
const pd = createBackendClient({
494494
environment: "development", // change to production if running for a test production account, or in production
@@ -509,7 +509,7 @@ const account = await pd.getAccountById(accountId, {
509509
</Tabs.Tab>
510510
<Tabs.Tab>
511511
```javascript
512-
import { createBackendClient } from "@pipedream/sdk";
512+
import { createBackendClient } from "@pipedream/sdk/server";
513513

514514
const pd = createBackendClient({
515515
environment: "development", // change to production if running for a test production account, or in production
@@ -632,7 +632,7 @@ DELETE /{project_id}/accounts/{account_id}
632632
```typescript
633633
import {
634634
createBackendClient,
635-
} from "@pipedream/sdk";
635+
} from "@pipedream/sdk/server";
636636

637637
const pd = createBackendClient({
638638
environment: "development", // change to production if running for a test production account, or in production
@@ -650,7 +650,7 @@ await pd.deleteAccount(accountId);
650650
</Tabs.Tab>
651651
<Tabs.Tab>
652652
```javascript
653-
import { createBackendClient } from "@pipedream/sdk";
653+
import { createBackendClient } from "@pipedream/sdk/server";
654654

655655
const pd = createBackendClient({
656656
environment: "development", // change to production if running for a test production account, or in production
@@ -716,7 +716,7 @@ The app ID for which you want to delete all connected accounts. `app_id` can be
716716
```typescript
717717
import {
718718
createBackendClient,
719-
} from "@pipedream/sdk";
719+
} from "@pipedream/sdk/server";
720720

721721
const pd = createBackendClient({
722722
environment: "development", // change to production if running for a test production account, or in production
@@ -734,7 +734,7 @@ await pd.deleteAccountsByApp(appId);
734734
</Tabs.Tab>
735735
<Tabs.Tab>
736736
```javascript
737-
import { createBackendClient } from "@pipedream/sdk";
737+
import { createBackendClient } from "@pipedream/sdk/server";
738738

739739
const pd = createBackendClient({
740740
environment: "development", // change to production if running for a test production account, or in production
@@ -800,7 +800,7 @@ DELETE /{project_id}/users/{external_user_id}
800800
```typescript
801801
import {
802802
createBackendClient,
803-
} from "@pipedream/sdk";
803+
} from "@pipedream/sdk/server";
804804

805805
const pd = createBackendClient({
806806
environment: "development", // change to production if running for a test production account, or in production
@@ -818,7 +818,7 @@ console.log("All accounts associated with the external ID have been deleted.");
818818
</Tabs.Tab>
819819
<Tabs.Tab>
820820
```javascript
821-
import { createBackendClient } from "@pipedream/sdk";
821+
import { createBackendClient } from "@pipedream/sdk/server";
822822

823823
const pd = createBackendClient({
824824
environment: "development", // change to production if running for a test production account, or in production
@@ -880,7 +880,7 @@ GET /{project_id}/info
880880
<Tabs items={['TypeScript', 'Node.js', 'HTTP (cURL)']}>
881881
<Tabs.Tab>
882882
```typescript
883-
import { createBackendClient } from "@pipedream/sdk";
883+
import { createBackendClient } from "@pipedream/sdk/server";
884884

885885
const pd = createBackendClient({
886886
environment: "development", // change to production if running for a test production account, or in production
@@ -898,7 +898,7 @@ const info = await pd.getProjectInfo({
898898
</Tabs.Tab>
899899
<Tabs.Tab>
900900
```javascript
901-
import { createBackendClient } from "@pipedream/sdk";
901+
import { createBackendClient } from "@pipedream/sdk/server";
902902

903903
const pd = createBackendClient({
904904
environment: "development", // change to production if running for a test production account, or in production

docs-v2/pages/connect/environments.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ You specify the environment when [creating a new Connect token](/connect/api/#cr
1414
Always set the environment when you create the SDK client:
1515

1616
```typescript
17-
import { createBackendClient } from "@pipedream/sdk";
17+
import { createBackendClient } from "@pipedream/sdk/server";
1818

1919
const pd = createBackendClient({
2020
environment: "development", // change to production if running for a test production account, or in production

docs-v2/pages/connect/migrating-from-project-keys-to-oauth.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Change the `@pipedream/sdk` version in your `package.json`:
3232
```json
3333
{
3434
"dependencies": {
35-
"@pipedream/sdk": "1.0.0"
35+
"@pipedream/sdk": "^1.0.0"
3636
}
3737
}
3838
```
@@ -59,7 +59,7 @@ You'll need to make two changes to your frontend client code:
5959
2. Change the `createClient` method to `createFrontendClient`.
6060

6161
```typescript
62-
import { createFrontendClient } from "@pipedream/sdk"
62+
import { createFrontendClient } from "@pipedream/sdk/browser"
6363
const pd = createFrontendClient()
6464
```
6565

@@ -74,7 +74,7 @@ You'll need to make three changes to your backend code:
7474
<Tabs items={['TypeScript', 'Node.js']}>
7575
<Tabs.Tab>
7676
```typescript
77-
import { createBackendClient, HTTPAuthType } from "@pipedream/sdk";
77+
import { createBackendClient, HTTPAuthType } from "@pipedream/sdk/server";
7878

7979
// These secrets should be saved securely and passed to your environment
8080
const pd = createBackendClient({
@@ -87,7 +87,7 @@ const pd = createBackendClient({
8787
</Tabs.Tab>
8888
<Tabs.Tab>
8989
```javascript
90-
import { createBackendClient } from "@pipedream/sdk";
90+
import { createBackendClient } from "@pipedream/sdk/server";
9191

9292
// These secrets should be saved securely and passed to your environment
9393
const pd = createBackendClient({

docs-v2/pages/connect/quickstart.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ In our example, `app/page.tsx` calls the `connectAccount` method from the Pipedr
119119
<Image src="https://res.cloudinary.com/pipedreamin/image/upload/v1724182571/connect-account-button-screenshot_n7vjvq.png" alt="Connect your account button" width={550} height={300} />
120120

121121
```typescript
122-
import { createFrontendClient } from "@pipedream/sdk"
122+
import { createFrontendClient } from "@pipedream/sdk/browser"
123123

124124
export default function Home() {
125125
const pd = createFrontendClient()
@@ -171,7 +171,7 @@ This example shows you how to fetch credentials by your end user's `external_use
171171
```typescript
172172
import {
173173
createBackendClient,
174-
} from "@pipedream/sdk";
174+
} from "@pipedream/sdk/server";
175175

176176
const pd = createBackendClient({
177177
environment: "development", // change to production if running for a test production account, or in production
@@ -197,7 +197,7 @@ async function getUserAccounts(external_user_id: string, include_credentials: bo
197197
```javascript
198198
import {
199199
createBackendClient,
200-
} from "@pipedream/sdk";
200+
} from "@pipedream/sdk/server";
201201

202202
const pd = createBackendClient({
203203
environment: "development", // change to production if running for a test production account, or in production

docs-v2/pages/connect/workflows.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Then invoke the workflow like so:
121121
<Tabs items={['TypeScript', 'Node.js', 'HTTP (cURL)']}>
122122
<Tabs.Tab>
123123
```typescript
124-
import { createBackendClient, HTTPAuthType } from "@pipedream/sdk";
124+
import { createBackendClient, HTTPAuthType } from "@pipedream/sdk/server";
125125

126126
// These secrets should be saved securely and passed to your environment
127127
const pd = createBackendClient({
@@ -148,7 +148,7 @@ await pd.invokeWorkflowForExternalUser(
148148
</Tabs.Tab>
149149
<Tabs.Tab>
150150
```javascript
151-
import { createBackendClient } from "@pipedream/sdk";
151+
import { createBackendClient } from "@pipedream/sdk/server";
152152

153153
// These secrets should be saved securely and passed to your environment
154154
const client = createBackendClient({

docs-v2/pages/rest-api/auth.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ In the client credentials model, you exchange your OAuth client ID and secret fo
3232
If you're running a server that executes JavaScript, we recommend using [the Pipedream SDK](/connect/api#installing-the-typescript-sdk), which automatically refreshes tokens for you.
3333

3434
```javascript
35-
import { createBackendClient } from "@pipedream/sdk";
35+
import { createBackendClient } from "@pipedream/sdk/server";
3636

3737
// These secrets should be saved securely and passed to your environment
3838
const pd = createBackendClient({

docs-v2/pages/workflows/triggers.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ You can use the Pipedream SDK to automatically refresh access tokens and invoke
146146
<Tabs items={['TypeScript', 'Node.js', 'HTTP (cURL)']}>
147147
<Tabs.Tab>
148148
```typescript
149-
import { createBackendClient, HTTPAuthType } from "@pipedream/sdk";
149+
import { createBackendClient, HTTPAuthType } from "@pipedream/sdk/server";
150150

151151
// These secrets should be saved securely and passed to your environment
152152
const pd = createBackendClient({
@@ -170,7 +170,7 @@ await pd.invokeWorkflow(
170170
</Tabs.Tab>
171171
<Tabs.Tab>
172172
```javascript
173-
import { createBackendClient } from "@pipedream/sdk";
173+
import { createBackendClient } from "@pipedream/sdk/server";
174174

175175
// These secrets should be saved securely and passed to your environment
176176
const pd = createBackendClient({
@@ -242,7 +242,7 @@ curl -F 'name=Leia' -F 'title=General' https://myendpoint.m.pipedream.net
242242

243243
Pipedream will convert that to a JavaScript object, `event.body`, with the following shape:
244244

245-
```json
245+
```js
246246
{
247247
name: "Leia",
248248
title: "General",

0 commit comments

Comments
 (0)