vercel / nextjs-subscription-payments

Clone, deploy, and fully customize a SaaS subscription application with Next.js.
https://subscription-payments.vercel.app/
MIT License
6.4k stars 1.3k forks source link

adding a blog feature - supabase access token #238

Open MincePie opened 1 year ago

MincePie commented 1 year ago

I am trying to use this template to make an app. I can deploy your code to vercel.

I tried to add a blog feature (all access policy for now).

I can run it in dev mode.

I cannot run npm run generate-types. I get an error back that says:

2023/08/18 11:19:58 Access token not provided. Supply an access token by running supabase login or setting the SUPABASE_ACCESS_TOKEN environment variable.

I don't know what this means, but I did make a new JWT secret and added it to my env.local as SUPABASE_ACCESS_TOKEN (which I now have along with the 2 NEXT_PUBLIC tokens and the SUPABASE_SERVICE_ROLE_KEY. I don't know what any of these are doing. All of them are added to my vercel env variables file.

Is there a tutorial on how to use this repo? I'm stuck on step 1 and can't get any sense out of chat gpt on what to try next.

I tried amending the script in the package json from:

"generate-types": "npx supabase gen types typescript --project-id YOUR_PROJECT_ID --schema public > types_db.ts"

to :

"generate-types": "npx supabase gen types typescript --project-id theProjectIdStringInVercel --schema public > types_db.ts"

but when i try to run this script, i get a forbidden access error. how can i run this script?

thank you

Starry-lord commented 1 year ago

Try this to add this as a new script in your package.json file:

"supabase:login": "npx supabase login"

Then, if your using vscode, you should see a new npm script available. Run it and then run "generate-types" again.