[SOLVED] No api key found - despite having api key in params

I'm trying to create twitter authentication with supabase. I
console.log
both of the
.env
params and they did show up. So i'm not sure why I'm getting the error {"message":"No API key found in request","hint":"No apikey request header or url param was found."} when I try to authenticate with Twitter.

.env
NEXT_PUBLIC_SUPABASE_URL="supabaseurl"
NEXT_PUBLIC_SUPABASE_ANON_KEY = "anonkey"


index.js
import supabaseClient from "../utils/supabaseClient.js"
export default function Home(props) {
  async function signInWithTwitter() {
    const supabase = supabaseClient()
    console.log(supabase)
    console.log(process.env.NEXT_PUBLIC_SUPABASE_URL, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY)
    const { data, error } = await supabase.auth.signInWithOAuth({
      provider: 'twitter',
    })
    console.log(data, error)
  }
return (<TwitterButton/>)


utils/supabaseClient.js
import {createClient} from "@supabase/supabase-js"

const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL;
const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;
console.log("something", supabaseUrl, supabaseAnonKey)
// const supabase = createClient(supabaseUrl, supabaseAnonKey); 

export default function supabaseClient() {
    return createClient(supabaseUrl, supabaseAnonKey); 
}
Was this page helpful?