#joohnnn_unexpected
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1309095448530915399
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- joohnnn_best-practices, 1 day ago, 6 messages
๐ happy to help
Is it a bad approach to specify stripe api version explicitly ?
no not really
src/configs/stripe.config.ts(5,3): error TS2322: Type '"2024-10-28.acacia"' is not assignable to type '"2024-11-20.acacia
this is a typing issue but I'm wondering why
Is it possible that stripe api version get update automatically in server ? What if I don't specify api version in code explicitly ?
- you may pass
nullor another version instead of the latest version,- and add a
@ts-ignorecomment here and anywhere the types differ between API versions.
the issue is you can't really change the API version, in the latest versions of stripe-node it's strongly-typed and pinned to specific API versions. version 17.3.1 uses the 2024-11-20.acacia API version. If you change that with apiVersion, the objects that come back on API responses will be 'shaped' for that older version so the typescript types might not match
@minor oasis I've tried like this:
export const stripe = new Stripe(env.stripeSecretKey!, {
// @ts-ignore-next-line
apiVersion: null,
});
It's running smoothly in local environment, but throwing this error in dev environment, I'm still clue less:
Error: Neither apiKey nor config.authenticator provided
sounds like env.stripeSecretKey is probably null then
Works now, thanks for your suggestion