Hey all, pretty new to supabase. I've made a scrap...
# help
j
Hey all, pretty new to supabase. I've made a scraper which adds info into a database, and now I would like for browsers to read this data. I havent yet set RLS, I want browsers to be able to read but not write (easy enough theres a template for that) but how would I allow my scraper function to access the database for insert?
I've only been able to find authentication for real users, not bots
s
If your scraper is running on a server, or another environment where users don't have access to the keys, you can use the service key to bypass RLS policies to write the data
j
Nice one! Thanks I'll have a look into 'service keys'
s
No worries 🙂 It's the same process for accessing the database - the only thing that changes is that you use the service key from your dashboard, instead of the public key
z
you can use something like this
Copy code
js
await  supabaseClient.auth.setAuth("your-service-key")
j
Wow that was a lot simpler than I thought, thanks again!