Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tjs): call TJS api from server with node-fetch #1445

Merged
merged 1 commit into from Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/skill-api/package.json
Expand Up @@ -42,6 +42,7 @@
"@skillrecordings/inngest": "workspace:*",
"@skillrecordings/stripe-sdk": "workspace:*",
"@slack/web-api": "^6.7.2",
"@types/node-fetch": "^2.6.2",
"concurrently": "^7.2.2",
"cookie": "^0.5.0",
"date-fns": "^2.28.0",
Expand All @@ -52,6 +53,7 @@
"lodash": "^4.17.21",
"micro": "^9.3.4",
"mjml": "^4.12.0",
"node-fetch": "^2.6.7",
"node-html-markdown": "^1.2.0",
"pluralize": "^8.0.0",
"preact": "^10.7.2",
Expand Down
Expand Up @@ -18,6 +18,7 @@ import {
Stripe,
} from '@skillrecordings/stripe-sdk'
import {z} from 'zod'
import nodeFetch, {Headers} from 'node-fetch'

const {stripe: defaultStripe} = defaultStripeContext

Expand Down Expand Up @@ -164,7 +165,7 @@ export async function receiveStripeWebhooks({
})

// not awaiting the fetch so that endpoint can return 200 right away
await fetch(internalStripeWebhookEndpoint, {
await nodeFetch(internalStripeWebhookEndpoint, {
method: 'POST',
headers,
body: payloadString,
Expand Down