[Feature Request] Using stripe-node outside of Node.js (e.g. Cloudflare Workers or Deno)
Problem
I'm trying to setup a Stripe service as a serverless function using the Cloudflare Workers platform. But the `stripe-node` package seems to depend on Node.js APIs. Is it possible to use a subset of `stripe-node`'s functionalities for Cloudflare Workers? Is supporting Cloudlfare Workers something you are interested in? Using Stripe in a no-cold-start serverless environment would be quite lovely. Would it be possible to extract the business logic that is agnostic to Node.js and expose it to users? So that we can use all kinds of platforms beyond Node.js, such as the Deno or Cloudflare Workers. It could be a new package, e.g. `stripe-js`. Thanks for what you are doing at Stripe, it's such a lovely product. Related tickets: https://github.com/stripe/stripe-node/issues/871 https://github.com/stripe/stripe-node/issues/773.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: [Feature Request] Using stripe-node outside of Node.js (e.g. Cloudflare Workers or Deno)
Hey @richardm-stripe @brillout โ I'm on the Workers team ๐ I'm super interested in helping this land! I've been playing around with the Stripe API inside of Workers and it seems like the `http` API is particularly the issue. Interestingly, I'm able to do some stuff that doesn't require requests (e.g. validating webhook signatures), but as soon as I try to make a request, it errors out! Ideally,
Trust Score
6 verifications
- 1
Hey @richardm-stripe @brillout โ I'm on the Workers team ๐
Hey @richardm-stripe @brillout โ I'm on the Workers team ๐
- 2
I'm super interested in helping this land! I've been playing around with the Str
I'm super interested in helping this land! I've been playing around with the Stripe API inside of Workers and it seems like the `http` API is particularly the issue. Interestingly, I'm able to do some stuff that doesn't require requests (e.g. validating webhook signatures), but as soon as I try to make a request, it errors out! Ideally, the Stripe SDK could use `fetch` (it's provided by default in the Workers environment), though I understand that's easier said than done. Let me know how I can help!
Validation
Resolved in stripe/stripe-node GitHub issue #997. Community reactions: 14 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep