Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wobsoriano/retry-stripe-loader
Stripe.js loadStripe function with retries.
https://github.com/wobsoriano/retry-stripe-loader
stripe stripe-js
Last synced: 3 months ago
JSON representation
Stripe.js loadStripe function with retries.
- Host: GitHub
- URL: https://github.com/wobsoriano/retry-stripe-loader
- Owner: wobsoriano
- License: mit
- Created: 2022-11-10T17:34:04.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-25T23:42:55.000Z (4 months ago)
- Last Synced: 2024-10-08T03:02:52.538Z (3 months ago)
- Topics: stripe, stripe-js
- Language: TypeScript
- Homepage:
- Size: 146 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# retry-stripe-loader
Stripe.js `loadStripe` function with retries.
## Install
```bash
npm install @stripe/stripe-js retry-stripe-loader
```## Usage
```ts
import { loadStripe } from 'retry-stripe-loader'const stripe = await loadStripe('pk_test_xxx', {
retryOptions: {
onFailedAttempt: (error) => {
console.log(`Attempt ${error.attemptNumber} failed. There are ${error.retriesLeft} retries left.`)
// 1st request => Attempt 1 failed. There are 4 retries left.
// 2nd request => Attempt 2 failed. There are 3 retries left.
// …
},
retries: 5
}
})
```## License
MIT