#wulff-stripejs-typescript

1 messages · Page 1 of 1 (latest)

royal ravenBOT
quick hornet
#

Hi, what does 'my app does not know what Stripe and I cannot see which methods I can call or their types' mean? What are you really trying to do? What integration guide are you following? Are you able to add a bit more details here so I can best assist?

boreal nova
#

If I import the stripe sdk, the editor will autocomplete things and have typescript definitions

#

For JS, of course

#

Given that it is "an official stripe partner"

#

Hm it doesn't support Vue3 yet unfortunately

quick hornet
boreal nova
#

I'm not following any guide at the moment, we just use Vue3 and the SDK from your CDN

#

I'm just confused about how I can include the library in my project and get the typescript definitions etc.

#

It works, I just have no code assistance as I cannot import anything when the SDK is not in my package.json

#

Is there a separate package that only includes types, perhaps?

#

Where I would then manually add the script tag but rely on the type package for autocompletion etc

halcyon pagoda
#

wulff-stripejs-typescript

boreal nova
#

But that one says:

Use Stripe.js as an ES module.

Note: To be PCI compliant, you must load Stripe.js directly from https://js.stripe.com. You cannot include it in a bundle or host it yourself. This package wraps the global Stripe function provided by the Stripe.js script as an ES module.
#

That's a little cryptic. Can I or can I not include this package?

halcyon pagoda
#

you can include this package, you just can't cache Stripe.js locally

boreal nova
#

but my entire app gets bundled into one app.js file with this one in it, no?

#

When compiling

halcyon pagoda
#

it's fine, it will just work, try this package

boreal nova
#

Okay so I just do the "import as a side effect" section?

halcyon pagoda
#

yes

boreal nova
#

Alright