Custom Auth Connection to Supabase

Hello, don’t mind me asking a beginner question. I’ve gone through all the topics related to my question but couldn’t find the answer.

I’m trying to establish a custom authentication connection with Supabase as the auth provider. After more than a day, I finally managed to set up the connection on localhost:3000, and everything worked locally. (I’m not sure if a published project should also work if I added localhost in the app host, didn’t work with mine.)

From what I understand now, I have to put these files on Github and from there push them to Vercel, Netlify, or a similar host to make this connection work permanently. However, the problem is that Github doesn’t upload my .env.local file with all the keys needed to make the connection work. Is there something I am missing or doing wrong?

Can someone please guide me? I apologize for such a beginner question, but I really hope someone can help me out.

Thank you.

ps. For reference: I am using the following for my connection https://github.com/plasmicapp/plasmic/tree/master/examples/supabase-auth-nextjs-pages-loader

This is a super simple issue so don’t stress!

Your .env.local file is really sensitive (often with API keys etc) and it’s bad practice to upload that to GitHub. What you need to do is publish your project to GitHub - which automatically excludes your env file - and then use that GitHub repo to launch a new Vercel project. In the setup of that project on Vercel, you’ll see environment variables as an option. You just copy the contents of your local env file into that and you’re good to go!

2 Likes

@tom_prest-drawbridge Thank you for your answer. It worked! :pray: