Skip to content

Commit 8c7b57b

Browse files
committed
update
1 parent 0a7b9a2 commit 8c7b57b

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import common from "@pipedream/apify";
2+
import { ApifyClient } from "apify-client";
23

34
export default {
45
type: "app",
@@ -8,12 +9,19 @@ export default {
89
},
910
methods: {
1011
...common.methods,
11-
_headers() {
12-
return {
13-
"Content-Type": "application/json",
14-
"Authorization": `Bearer ${this.$auth.oauth_access_token}`,
15-
"x-apify-integration-platform": "pipedream",
16-
};
12+
_client() {
13+
return new ApifyClient({
14+
token: this.$auth.oauth_access_token,
15+
requestInterceptors: [
16+
(config) => ({
17+
...config,
18+
headers: {
19+
...(config.headers || {}),
20+
"x-apify-integration-platform": "pipedream",
21+
},
22+
}),
23+
],
24+
});
1725
},
1826
},
1927
};

components/apify_oauth/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/apify": "^0.3.1"
16+
"@pipedream/apify": "^0.3.1",
17+
"apify-client": "^2.17.0"
1718
}
1819
}

0 commit comments

Comments
 (0)