Skip to content

Retain the same service role key for local development #3324

@percarlsen

Description

@percarlsen

Is your feature request related to a problem? Please describe.
Supabase webhooks do not work well across environments because the URL is retained. In order to bypass this, I'm storing the url and service role key in the vault and have created a custom function that calls the edge function using the url and service role key from the vault. (See this post for details if interested: https://stackoverflow.com/a/78900192)

This works fine in production and staging, but I've come across a problem for my local development environment. The service role key seems to be re-generated when running supabase start, meaning that I won't have the same service role key as the other devs in the team. This is cumbersome because each dev now has to either maintain their own key in the config file ([db.vault]) or in the seed file (both of which are tracked by git). I also have to change it whenever re-starting supabase.

Describe the solution you'd like
Make it possible to keep the same service role key for local dev. For example pass it as a flag to supabase start or store it in an .env file.

Describe alternatives you've considered
Currently bypassing this by disabling jwt when running edge functions locally (as this is currently my only use-case for having the service role key in the vault).

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions