I have RLS enabled on my database table but I can ...
# javascript
j
I have RLS enabled on my database table but I can still read and write data with the anonymous key. Why is this?
Copy code
js
const { createClient } = require('@supabase/supabase-js')

const supabaseUrl = "https://jnalzpuoivntwiythznc.supabase.co";
const supabaseAnonKey = "MY_ANON_KEY";

const supabase = createClient(supabaseUrl, supabaseAnonKey);

(async function getData() {
  const {data, error} = await supabase
    .from("vaults")
    .select("*");
  console.log(data);
})();
g
What are your RLS policies?
j
none. i figured that, based on the things i read, because i enabled it i wouldnt be able to do anything
g
that would be true....
Are you sure you have anon key and not service_role key?
j
oh my gosh 🤦‍♂️ i was using the service_role key