Skip to content

Commit

Permalink
fix(tjs): call TJS api from server with node-fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
jbranchaud authored and kodiakhq[bot] committed Mar 13, 2024
1 parent be00613 commit 30ff3e4
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 80 deletions.
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

0 comments on commit 30ff3e4

Please sign in to comment.