https://github.com/wefixers/stripe-js
Naked loading wrapper for Stripe.js
https://github.com/wefixers/stripe-js
Last synced: 3 months ago
JSON representation
Naked loading wrapper for Stripe.js
- Host: GitHub
- URL: https://github.com/wefixers/stripe-js
- Owner: wefixers
- License: mit
- Created: 2023-07-13T18:35:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-01T18:05:51.000Z (over 1 year ago)
- Last Synced: 2025-03-04T20:34:42.848Z (3 months ago)
- Language: TypeScript
- Size: 83 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Stripe-js
> This package is ESM only!
Just like the old good `@stripe/stripe-js`, but no side-effects, no console logs and no warnings.
## Usage
```ts
import { loadStripe } from '@fixers/stripe-js'// Stripe.js will not be loaded until `loadStripe` is called
const stripe = await loadStripe('pk_test_TYooMQauvdEDq54NiTphI7jx')
```### Disabling advanced fraud detection signals
If you would like to [disable advanced fraud detection](https://stripe.com/docs/disputes/prevention/advanced-fraud-detection#disabling-advanced-fraud-detection) altogether, you need to manually load the script:
```ts
import { loadScript } from '@fixers/stripe-js'const stripe = await loadScript({
advancedFraudSignals: true
})// Note: stripe is undefined in SSR
return stripe('pk_test_TYooMQauvdEDq54NiTphI7jx')
```