# How to rotate the secrets of your Supabase integration

**Author:** Zachary Balda

---

Secret rotation is a security best practice that limits the exposure window if a credential is compromised. You might rotate secrets when:

- A team member with access to credentials leaves
  
- You suspect a credential has been exposed
  
- Your security policy requires periodic rotation
  

These steps will guide you on updating the password for your Supabase database.

### Prerequisites

\- You have a Supabase database through a Native integration from Vercel Marketplace.

\- You have access to manage your account's resources, including your Supabase integration.

### Steps

#### Go to Supabase from your integration

1\. From your Vercel dashboard, go to the Integrations tab.

2\. Next to the integration, select the Manage button. Native integrations appear with a billable badge.

3\. Find and select the database that has secrets you want to rotate.

4\. Select the Open in Supabase button.

#### Rotate JWT secret key

1\. Go to **Project Settings**

2\. Go to **JWT Keys**

3\. Locate the **Legacy JWT Secret** section

4\. Select **Change legacy JWT secret**

5\. Select **Generate a random secret,** then type: `I understand and wish to proceed` in the confirmation field and select the **Generate random secret** button.

> Changing the JWT secret will invalidate all existing user sessions. Users will need to log in again.

#### Rotate Postgres password

1\. Go to **Database settings**

3\. Select **Reset database password**

4\. Select **Generate a password & Reset password**

> All database connections will be terminated when you reset the password. Your application will lose database connectivity until you redeploy with the new password.

### Rotate Supabase secret key

1\. Go to **Project Settings**

2\. Go to **API Keys**

3\. Select **New secret key**

4\. Enter a name and select **Create API key**

5\. Select the three dots next to the old key

6\. Select **Delete the API key**, enter the name and confirm

### Redeploy in Vercel

1\. From your Vercel [dashboard](https://vercel.com/dashboard), select your project

2\. Go to the **Deployments** tab

3\. Find your latest production deployment

4\. Select the three dots and select **Redeploy**

---

[View full KB sitemap](/kb/sitemap.md)
