joschan21 / quill

Quill - A Modern SaaS-Platform Built With Next.js 13
1.91k stars 513 forks source link

tRPC error calling Stripe, missing API #72

Closed mcpdigital closed 9 months ago

mcpdigital commented 9 months ago

I tried to find the reason of this problem, and I do not know how to fix it in the headers or bearer something like that. The env file is correct except for the webhook. There is a direct link checkout page of the product that could be used instead, but I would prefer to know what is going on.

UpgradeButton.tsx:16 TRPCClientError: You did not provide an API key. You need to provide your API key in the Authorization header, using Bearer auth (e.g. 'Authorization: Bearer YOUR_SECRET_KEY'). See https://stripe.com/docs/api#authentication for details, or we can help at https://support.stripe.com/. at TRPCClientError.from (TRPCClientError-38f9a32a.mjs:27:1) at eval (httpBatchLink-d0f9eac9.mjs:189:59)

mcpdigital commented 9 months ago

Fixed this, change the name to the env STRIPE_API_KEY -> export const stripe = new Stripe(process.env.STRIPE_API_KEY ?? "", { apiVersion: "2023-08-16", typescript: true, });