Search code examples
postgresqlsupabasesupabase-databasepostgrest

How to access a Supabase Vault Secret from my app?


I am trying to query a secret from supabase vault into my app but I am not sure how to do that.

Do I need to create a rpc function or is it possible to use the postgREST API? For the latter, what is the right endpoint?

Thanks


Solution

  • You cannot get the secrets itself stored on Vault from your client applications, but you can use Vault to encrypt your data in your database.

    You can follow this guide to encrypt a column. You would need to use a security definer database function when accessing the encrypted column.