Vault - Creating secrets in edge functions
Hey all,
I'm trying to create a vault secret inside my edge functions, using
supabase-js
.
Tried so many variations, both of supabase.rpc()
and supabase.select()
- but nothing works.
The RPC call throws this -
The select throws this -
The docs around the Vault are very minimal.
Would love for some help here !5 Replies
You access other schemas with .schema(‘vault’).from. Otherwise the schema is always public.
Problem is though vault is not exposed to the API and not sure service_role has grants. An RPC call to a security definer function might be needed but take away grants to anon and authenticated for it.
Cool, now that I use the
.schema
(and RPC) I get this -
The issue is that using the local env i'm not sure how I should expose the vault schema.You would have to set the schema in the .toml file setting to allow access. It is a PostgREST setting. BUT you should not allow access to Vault to the API.
That's amazing - works like a charm. I would say that the vault operations needs a mention in the docs.
Which vault operations would those be?