Hi, I have a form on a page that users can input their email to receive notifications about updates for a product.
How do I connect this to supabase?
I know from the docs that I need to create this client using the below and I've created a supabase-client.js to put it, but I notice the syntax for creating it is different for javascript (that's me) then typescript, and there seem to be different conventions i.e storing the url and keys directly in this file, vs using a .env, vs a .env.local. I've tried to import it via import.env.local.supabaseURL, but it throws up an error. So what is the syntax for importing a .env file? I'm on javascript.
Any help appreciated!
import { createClient } from '@supabase/supabase-js'
// Create a single supabase client for interacting with your database const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-or-anon-key')
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.