Stripe Error: "ReferenceError: require is not defined"

I'm trying to add Stripe to a SolidStart project.

In the Stripe docs, they ask you to initialize Stripe on the server with:

const stripe = require("stripe")('secret_key');


But
require()
doesn't work in SolidStart. You have to use import.

After talking with Stripe, they said they didn't have an ES6 equivalent for initializing Stripe on the server.

So...

  1. How can I get around this problem?
  2. Are there any good examples of how to get Stripe working in SolidStart?
Was this page helpful?