Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: simplify NextStripe initialization #14

Merged
merged 2 commits into from Jan 30, 2021
Merged

Conversation

balazsorban44
Copy link
Contributor

@balazsorban44 balazsorban44 commented Jan 29, 2021

This is similar to what we did in NextAuth.js, see nextauthjs/next-auth#868

Makes possible to do this:

export default NextStripe(options)

instead of:

export default (req, res) => NextStripe(req, res, options)

It is fully backward compatible with the old initialization.

I can update the docs if you are interested. 馃檪

In the README.md, it could simply read:

import NextStripe from 'next-stripe'

export default NextStripe({
  secret_key: process.env.STRIPE_SECRET_KEY
})

@ynnoj
Copy link
Owner

ynnoj commented Jan 29, 2021

@balazsorban44 Thanks for the PR! Could you please update the README?

@ynnoj ynnoj self-assigned this Jan 29, 2021
@balazsorban44
Copy link
Contributor Author

Done @ynnoj!

@ynnoj ynnoj merged commit fedcfc6 into ynnoj:beta Jan 30, 2021
@github-actions
Copy link

馃帀 This PR is included in version 1.0.0-beta.8 馃帀

The release is available on:

Your semantic-release bot 馃摝馃殌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants