> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nekt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Supabase as a destination

> Send your data from Nekt to Supabase.

Supabase is an open-source Backend as a Service (BaaS) platform that provides a hosted PostgreSQL database with real-time subscriptions, authentication, and file storage. It's positioned as an open-source alternative to Firebase and is ideal for building modern applications with a powerful, scalable database backend.

<img height="50" src="https://mintcdn.com/nekt/h1spgKxG1l5LNY-b/assets/logo/logo-supabase.jpeg?fit=max&auto=format&n=h1spgKxG1l5LNY-b&q=85&s=e9435e411dd1389f6f48c6dbb28520d3" data-path="assets/logo/logo-supabase.jpeg" />

## 1. Get your Supabase connection details

Before configuring Supabase as a destination, you'll need to obtain the **Session Pooler** connection string from your Supabase project.

<Warning>
  **Important:** You must use the **Session Pooler** connection method. This is required for compatibility with Nekt's data loading process. The Transaction mode and Direct connection will not work properly.
</Warning>

### Finding your Session Pooler credentials

<Steps>
  <Step title="Open your Supabase project">
    Go to [supabase.com](https://supabase.com) and open your project dashboard.
  </Step>

  <Step title="Click the Connect button">
    In the top navigation bar, click the **Connect** button to view your connection options.
  </Step>

  <Step title="Select Session Pooler">
    In the connection dialog, select the **Session pooler** tab. This mode connects to your PostgreSQL instance via Supavisor and is required for proper data loading.

    The Session pooler connection string looks like this:

    ```
    postgres://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-[REGION].pooler.supabase.com:5432/postgres
    ```
  </Step>

  <Step title="Copy your connection details">
    From the connection string, extract the following values:

    * **Host**: `aws-0-[REGION].pooler.supabase.com` (e.g., `aws-0-us-east-1.pooler.supabase.com`)
    * **Port**: `5432`
    * **User**: `postgres.[PROJECT-REF]` (e.g., `postgres.abcdefghijklmnop`)
    * **Password**: Your database password
    * **Database**: `postgres`

    <Note>
      The username for Session pooler includes your project reference (e.g., `postgres.abcdefghijklmnop`), which is different from the direct connection username (`postgres`).
    </Note>
  </Step>
</Steps>

<Info>
  **Why Session Pooler?** The Session pooler provides a stable connection through Supavisor that supports IPv4 networks and maintains session state throughout the connection lifetime. This is essential for data loading operations that require consistent database sessions.
</Info>

## 2. Allow Nekt's IP to access your database

Supabase lets you restrict database access to specific IP addresses through **Network Restrictions**. If this feature is enabled on your project, you must whitelist Nekt's public IP so that the pipeline can connect to your database.

<Info>
  You can find **Nekt's public IP address** on the connector configuration page, displayed when setting up your Supabase destination. Copy it before proceeding with the steps below.
</Info>

<Steps>
  <Step title="Open your Supabase project settings">
    Go to [supabase.com](https://supabase.com), open your project, and navigate to **Project Settings** in the left sidebar.
  </Step>

  <Step title="Go to Network Restrictions">
    Under the **Database** section in the settings menu, select **Network Restrictions**.
  </Step>

  <Step title="Add Nekt's IP address">
    Click **Add CIDR** and enter Nekt's public IP address in CIDR notation. For a single IP address, append `/32` at the end (e.g., `203.0.113.42/32`).
  </Step>

  <Step title="Save your changes">
    Click **Apply** (or **Save**) to update the network restrictions. The change takes effect immediately.
  </Step>
</Steps>

<Warning>
  If **Network Restrictions** are configured but Nekt's IP is not whitelisted, all connection attempts from Nekt will be refused. If you are unsure whether restrictions are enabled, open the **Network Restrictions** page — if the list is empty or the feature is disabled, no action is required.
</Warning>

## 3. Add your Supabase access

1. In the [Destinations](https://app.nekt.ai/destinations) tab, click on the "Add destination" button located on the top right of your screen. Then, select the Supabase option from the list of connectors.

2. Click **Next** and you'll be prompted to add your access using the Session pooler credentials you obtained:
   * **Host**: Your pooler host (e.g., `aws-0-us-east-1.pooler.supabase.com`)
   * **Port**: `5432`
   * **User**: Your pooler username (e.g., `postgres.abcdefghijklmnop`)
   * **Password**: Your database password
   * **Database**: `postgres`
   * **Target Schema**: The schema where your data will be loaded (e.g., `public`)

3. Define your load method: append, upsert or overwrite.

   <Accordion title="Load methods">
     * **Append:** This method will simply add all records from the incoming
       dataset to the existing table at the destination, without removing or
       updating any existing data. You can only use this method if a primary key
       was not defined for the input table.
     * **Upsert:** This method will check
       for records with matching IDs in the destination table. If a match is
       found, the existing record will be updated with the new data. If no match
       is found, the new record will be inserted. In other words, it merges the
       incoming dataset with the existing table based on the record ID.
     * **Overwrite:** This method will completely replace all existing data in the
       destination table with the incoming dataset. Any data that was previously
       in the table will be deleted.
   </Accordion>

4. Decide about:

* **Enabling SSL**: SSL is enabled by default and recommended for Supabase connections to ensure encrypted communication.
* **Adding record metadata**: If active, it will add metadata columns with timestamps related to the loading process. Read more about each column below.
  <Accordion title="Record metadata">
    * `_sdc_extracted_at`: Timestamp indicating when record was extracted from
      the source
    * `_sdc_received_at`: Timestamp indicating when the destination
      received the record for loading
    * `_sdc_batched_at`: Timestamp indicating
      when the destination loaded the batch the record was a part of into the
      destination
    * `_sdc_sequence`: A Unix epoch (in nanoseconds) that indicates
      the order in which data points were considered for loading -
      `_sdc_table_version`: Indicates the version of the table. Used to determine
      when to issue TRUNCATE commands during loading, where applicable.
  </Accordion>

5. Click **Next**.

## 4. Select your data to send

1. The next step is letting us know which data you want to send to the database. Select the layer and then the desired table.

   > Tip: The table can be found more easily by typing its name.

2. Define which column from the selected table should be used as primary key on the destination database.

3. Click **Next**.

## 5. Configure your Supabase data destination

1. Describe your destination for easy identification within your organization. You can inform things like what data it sends, to which team it belongs, etc.

2. To define your [Trigger](https://docs.nekt.com/runs/scheduling-and-triggers), consider how often you want data to be sent to this destination. This decision usually depends on how frequently you need the new table data updated (every day, once a week, only at specific times, etc.).

3. Click **Done**.

### Check your new destination!

1. Once completed, you'll receive confirmation that your new destination is set up!

2. You can view your new destination on the [Destinations](https://app.nekt.ai/destinations) page. Now, for you to be able to see it on your Supabase database, you have to wait for the pipeline to run. You can monitor it on the [Destinations](https://app.nekt.ai/destinations) page to see its execution and completion. If needed, manually trigger the pipeline by clicking on the refresh icon. Once executed, your data should be visible in your Supabase Table Editor or via SQL queries.

## Troubleshooting

<Accordion title="Connection failed error">
  If you encounter a connection error, verify that:

  1. You are using the **Session pooler** connection string, not the Direct connection or Transaction pooler
  2. The username includes your project reference (e.g., `postgres.abcdefghijklmnop`)
  3. The host is the pooler host (ends with `.pooler.supabase.com`), not the direct database host
  4. Your database password is correct - you can reset it in the Supabase dashboard under Project Settings > Database
  5. Nekt's public IP is whitelisted in your project's **Network Restrictions** (Project Settings > Database > Network Restrictions)
</Accordion>

<Accordion title="Connection refused due to IP restrictions">
  If your connection is being refused and you have Network Restrictions enabled:

  1. Go to your Supabase project **Settings > Database > Network Restrictions**
  2. Confirm that Nekt's public IP (shown on the connector configuration page in Nekt) appears in the allowed CIDR list
  3. If it is missing, add it in the format `<IP_ADDRESS>/32` and click **Apply**
  4. Retry the connection after saving — changes take effect immediately
</Accordion>

<Accordion title="Permission denied error">
  If you see permission errors:

  1. Make sure the database user has the necessary permissions to create tables and insert data in the target schema
  2. If using a custom schema, ensure it exists and the user has access to it
</Accordion>

> If you encounter any issues, reach out to us via Slack, and we'll gladly assist you!
