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

# Supabase authentication

> Set up Supabase Authentication in FunnelFox. Enable email and social login for your web funnel users.

The [Supabase integration](https://app.funnelfox.com/integrations/supabase) enables multiple authentication methods while maintaining a consistent user identity.

## How it works

FunnelFox authenticates users directly within your funnels, giving each user a stable Supabase UID. It will either:

* **Create a new Supabase user (sign up)**: If no user exists for the customer's credentials.
* **Authenticate an existing Supabase user (sign in)**: If the user was created during a previous funnel experience and signs in using an OAuth button.

Once the user is authenticated, your app takes over the in-app authentication flow.

The email entered by the customer (via Email input or OAuth) is saved as the `{{email}}` funnel variable. You can use it in upstream screens, for example, in deep links.

### Email & Password authentication

Email-based authentication occurs when the customer navigates from the authentication screen with email/password inputs filled out.

**Sign up:**

When a customer submits their credentials in a funnel, FunnelFox automatically handles Supabase user creation:

* FunnelFox creates a Supabase user with email and password-based authentication.
* By default, a secure random password is generated for the user.
* If the same screen includes a Password input element, that value replaces the generated password.

<Tip>For the Email/Password sign up, we recommend using the Password input element. If you rely on the generated random password, it won't be accessible to the user, so you'll need to implement a [password reset flow](https://supabase.com/docs/guides/auth/passwords#resetting-a-password) during the in-app authentication step.</Tip>

**Sign in:**

Email-based sign in is not currently supported. This feature is under development.

### OAuth authentication

Unlike email/password authentication, OAuth works right when the customer uses the OAuth button.

OAuth providers enable seamless social authentication within your funnels:

* Enable OAuth providers (e.g., Google or Apple) in Supabase and add OAuth buttons in the Editor.
* Users receive a secure and seamless authentication experience:
  * If it's the user's first time, Supabase creates the account.
  * If the account already exists, Supabase signs them in using the same OAuth buttons.

### User identification

The Supabase UID serves as the canonical identifier for each authenticated user within FunnelFox. It is stored on the user's profile and available to your app after authentication.

## Setup

Complete the Supabase integration by creating a Supabase project and connecting it to FunnelFox.

<Warning>Only one authentication integration can be enabled at a time. If you have the Firebase integration enabled, disable it first in [Integrations > Firebase](https://app.funnelfox.com/integrations/firebase) before continuing.</Warning>

### 1. Create Supabase project

Start by setting up a new project in the [Supabase dashboard](https://supabase.com/dashboard).

1. Click **+ New project**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-new-project.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=7f01d009843a1190279974328a7b4d53" width="1920" height="879" data-path="assets/supabase-new-project.png" />
</Frame>

2. Name your project and set a database password.
3. Click **Create new project**.

### 2. Configure auth providers

Email/Password is enabled by default and requires no additional setup.

Select an OAuth provider to configure.

<Tabs>
  <Tab title="Google OAuth">
    Google OAuth provides seamless authentication using Google accounts. You'll configure your Google Cloud console to authorize your FunnelFox domain, then enable the provider in Supabase.

    You need an existing project in the [Google Cloud console](https://console.cloud.google.com/). If you don't have one, create it before continuing.

    **Google Cloud console configuration**

    <Info>You will need your full project URL for this step. Go to [Settings > Domains](https://app.funnelfox.com/settings/domains) in your FunnelFox project and copy your project URL, e.g. `https://demo-app.fnlfx.com`.</Info>

    1. Go to **APIs & Services > Credentials** from the **Quick access** section.

    <Frame>
      <img src="https://mintcdn.com/funnelfox/_9jmOZHt8c-XeasZ/assets/api-services.gif?s=c55ca1e041ce38754f5a4a247ab2123d" alt="APIs and Services" width="1656" height="802" data-path="assets/api-services.gif" />
    </Frame>

    2. Open the web client auto-created by Google Service under **OAuth 2.0 Client IDs**.

    <Frame>
      <img src="https://mintcdn.com/funnelfox/Nggd7btibyPuEAU_/assets/web-client.png?fit=max&auto=format&n=Nggd7btibyPuEAU_&q=85&s=c7d8a613343ba259e1d3cbabf4fb008d" alt="Web client" width="1558" height="801" data-path="assets/web-client.png" />
    </Frame>

    3. Click **Add URL** twice under **Authorized JavaScript origins**, and set up the following two fields:
       * Paste your full project URL.
       * Paste `https://app.funnelfox.com`.

    <Frame>
      <img src="https://mintcdn.com/funnelfox/0pzxPSifplVcrwL9/assets/add-project-url.png?fit=max&auto=format&n=0pzxPSifplVcrwL9&q=85&s=dfda3018b214e36f5002372137a16114" alt="Project URL" width="1920" height="879" data-path="assets/add-project-url.png" />
    </Frame>

    4. Click **Add URL** twice under **Authorized redirect URIs**, and set up the following two fields:
       * Paste your full project URL + `/__/auth/handler`. Your final URL will look like `https://demo-app.fnlfx.com/__/auth/handler`.
       * Paste `https://app.funnelfox.com/__/auth/handler`.

    <Frame>
      <img src="https://mintcdn.com/funnelfox/XYWX2neK48GjB2np/assets/final-url.png?fit=max&auto=format&n=XYWX2neK48GjB2np&q=85&s=b64bdf09da6ef7d60ffbde7817175801" alt="Redirect URL" width="1920" height="879" data-path="assets/final-url.png" />
    </Frame>

    5. Copy your **Client ID** under **Additional information** at the top right.

    **Supabase configuration**

    1. Go to **Authentication > Sign In / Providers** in your Supabase project.

    <Frame>
      <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-providers.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=3da549657daaba37f8ee1606cc7e205e" width="1920" height="879" data-path="assets/supabase-providers.png" />
    </Frame>

    2. Select **Google** under **Auth Providers**.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-google.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=4e9cbd90c72c16624eddfcd2c8cd913f" width="1920" height="879" data-path="assets/supabase-google.png" />
           </Frame>

    3. Toggle on **Enable Sign in with Google**.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-enable-google-sign-in.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=cceb024e82302c090bf53df060d11f88" width="1920" height="879" data-path="assets/supabase-enable-google-sign-in.png" />
           </Frame>

    4. Paste your Client ID into the **Client IDs** field.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-paste-clientid.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=1fea12c37ba63fcbe6e6e41ca988b415" width="1920" height="879" data-path="assets/supabase-paste-clientid.png" />
           </Frame>

    5. Go back to your Google Cloud console and click **+ Add secret** under **Client secrets**.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-add-secret.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=adbfa987fdc5ed489b182932940516c6" width="1920" height="879" data-path="assets/supabase-add-secret.png" />
           </Frame>

    6. Copy your new client secret.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-copy-secret.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=77e22ca1cdefc42378ab4b91a88802d6" width="1920" height="879" data-path="assets/supabase-copy-secret.png" />
           </Frame>

    7. Go back to Supabase and paste the secret into **Client Secret (for OAuth)**.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-paste-secret.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=ea1a759b895e5d9595d3c15351c7223a" width="1920" height="879" data-path="assets/supabase-paste-secret.png" />
           </Frame>

    8. Click **Save**.

    9. Copy the **Callback URL (for OAuth)**.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-copy-callback-url.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=5c2ca7c03db61b018767a81ad4392872" width="1920" height="879" data-path="assets/supabase-copy-callback-url.png" />
           </Frame>

    10. Go back to the **Authorized redirect URIs** in Google Cloud console and add one more URI with the callback URL from Supabase.

            <Frame>
              <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-add-URI.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=0d1e16662f5cae5d270ea05e4333a8a6" width="1920" height="879" data-path="assets/supabase-add-URI.png" />
            </Frame>

    11. Click **Save**.

    12. Go to **Authentication > URL Configuration** in Supabase and make sure the following domains are added under **Redirect URLs**:

    * Your full project URL.
    * `https://app.funnelfox.com`
    * Your custom domains (if any).

          <Frame>
            <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-authorized-urls.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=c5b864082fae2265e3ee2a82d25e337d" width="1920" height="879" data-path="assets/supabase-authorized-urls.png" />
          </Frame>
  </Tab>

  <Tab title="Apple OAuth">
    Apple OAuth provides seamless authentication using Apple ID. You'll configure your Service ID and key in Apple Developer Portal, then set up the provider in Supabase.

    <Info>You will need an **App ID** registered with enabled **Sign in with Apple** capability. Learn about [App IDs in Apple documentation](https://developer.apple.com/help/account/identifiers/register-an-app-id) if you don't have one.</Info>

    **Apple Service ID configuration**

    1. Go to [Certificates, Identifiers & Profiles > Identifiers](https://developer.apple.com/account/resources/identifiers) in your Apple Developer Portal.

    2. Click **+** to create a new identifier.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/mlvS9z__U8OurXty/assets/add-identifier.png?fit=max&auto=format&n=mlvS9z__U8OurXty&q=85&s=5597fe3cfd454a14a413351cd45067ca" width="1257" height="518" data-path="assets/add-identifier.png" />
           </Frame>

    3. Select **Services IDs** and click **Continue**.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/1m79HrOn0fNLyjf5/assets/services-ids.png?fit=max&auto=format&n=1m79HrOn0fNLyjf5&q=85&s=1cf311d9ee015953d0733db9d5f45c60" width="1249" height="701" data-path="assets/services-ids.png" />
           </Frame>

    4. Enter your Service ID **Description** and **Identifier**. Use reverse-domain naming, e.g. `com.yourdomain.oauth`.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/1m79HrOn0fNLyjf5/assets/service-id-details.png?fit=max&auto=format&n=1m79HrOn0fNLyjf5&q=85&s=1a980d93ae2e20405af985ff7ad49959" width="1257" height="403" data-path="assets/service-id-details.png" />
           </Frame>

    5. Click **Continue**, then **Register**.

    6. Open the Service ID you just created.

    7. Enable **Sign In with Apple** and click **Configure**.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/mlvS9z__U8OurXty/assets/checkmark-signin-apple.png?fit=max&auto=format&n=mlvS9z__U8OurXty&q=85&s=b11c40014027ee43d15c376386d754d5" width="1257" height="517" data-path="assets/checkmark-signin-apple.png" />
           </Frame>

    8. Configure the Web Authentication:

       * **Primary App ID**: Select your App ID.
       * **Domains and Subdomains**: Add two domains
         * Your project domain from [Settings > Domains](/dashboard/settings#domains) in FunnelFox, e.g. `demo-app.fnlfx.com`.
         * `https://app.funnelfox.com`.
       * **Return URLs**: Add two return domains
         * Your project domain with the auth handler path: `https://YOUR_DOMAIN/__/auth/handler`. For example, `https://demo-app.fnlfx.com/__/auth/handler`.
         * `https://app.funnelfox.com/__/auth/handler`.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/M8vAy7IXyE_xdO8W/assets/web-authentication-config.png?fit=max&auto=format&n=M8vAy7IXyE_xdO8W&q=85&s=2b5a6c174e1518ddf8e860723c3ca730" width="1281" height="825" data-path="assets/web-authentication-config.png" />
           </Frame>

    9. Click **Next**, then click **Done**.

    10. Click **Continue**, then click **Save** to the right from **Services ID Configuration**.

    **Apple key configuration**

    1. Go to the **Keys** tab in [Certificates, Identifiers & Profiles](https://developer.apple.com/account/resources/identifiers).

    2. Click **+** to create a new key.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/mlvS9z__U8OurXty/assets/add-key.png?fit=max&auto=format&n=mlvS9z__U8OurXty&q=85&s=a9d37f78de70f3fe36417204e82211b5" width="1260" height="457" data-path="assets/add-key.png" />
           </Frame>

    3. Name your key.

    4. Enable **Sign in with Apple** and click **Configure**.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/mlvS9z__U8OurXty/assets/configure-key.png?fit=max&auto=format&n=mlvS9z__U8OurXty&q=85&s=b6f427e45b039dc7627004fd4e6c194c" width="1306" height="860" data-path="assets/configure-key.png" />
           </Frame>

    5. Select your **Primary App ID** and click **Save**.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/fE-ClzZI29xgbnLX/assets/key-primary-addid.png?fit=max&auto=format&n=fE-ClzZI29xgbnLX&q=85&s=4d7f3a8e60851bf6ee962ebb45d1cb55" width="1249" height="443" data-path="assets/key-primary-addid.png" />
           </Frame>

    6. Click **Continue**, then click **Register**.

    7. Click **Download** to save your key file. You'll need it in the next step.

       <Warning>You can download the key file only once.</Warning>

           <Frame>
             <img src="https://mintcdn.com/funnelfox/fE-ClzZI29xgbnLX/assets/key-download.png?fit=max&auto=format&n=fE-ClzZI29xgbnLX&q=85&s=8ddec381c51295a3817d8053f910d879" width="1251" height="544" data-path="assets/key-download.png" />
           </Frame>

    **Supabase configuration**

    1. Go to **Authentication > Sign In / Providers** in your Supabase project.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-providers.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=3da549657daaba37f8ee1606cc7e205e" width="1920" height="879" data-path="assets/supabase-providers.png" />
           </Frame>

    2. Select **Apple** under **Auth Providers**.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-select-apple.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=734fd41fccc1b4d5a3f2ad2a9fba43bc" width="1920" height="879" data-path="assets/supabase-select-apple.png" />
           </Frame>

    3. Toggle on **Enable Sign in with Apple**.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-enable-apple.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=a3e52e26a2bcda7f32f16b3a328c7974" width="1920" height="879" data-path="assets/supabase-enable-apple.png" />
           </Frame>

    4. Enter your Apple service ID details:

       * **Client IDs**: The identifier for the Service ID you created.
       * **Secret Key (for OAuth)**: The contents of the key file you downloaded.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-enter-apple-details.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=f6f529bc4fc8ddc34968c5d5c1bb2e8f" width="1920" height="879" data-path="assets/supabase-enter-apple-details.png" />
           </Frame>

    5. Click **Save**.

    6. Copy the **Callback URL (for OAuth)**.

           <Frame>
             <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-copy-callback-url.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=5c2ca7c03db61b018767a81ad4392872" width="1920" height="879" data-path="assets/supabase-copy-callback-url.png" />
           </Frame>

    7. Go back to configuring Web Authentication for your service ID in Apple and add one more **Return URL** with the callback URL from Supabase.

    8. Go back to **Authentication > URL Configuration** in Supabase and make sure the following domains are added under **Redirect URLs**:

    * Your full project URL.
    * `https://app.funnelfox.com`
    * Your custom domains (if any).

          <Frame>
            <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-authorized-urls.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=c5b864082fae2265e3ee2a82d25e337d" width="1920" height="879" data-path="assets/supabase-authorized-urls.png" />
          </Frame>
  </Tab>
</Tabs>

### 3. Connect Supabase to FunnelFox

Retrieve your project credentials from Supabase and add them to FunnelFox.

1. In your Supabase project, hover over your project URL in the top navigation. You will see your **Project URL** and **Publishable Key**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/2s_llIA7YT0pe69a/assets/supabase-url.png?fit=max&auto=format&n=2s_llIA7YT0pe69a&q=85&s=335121307211add959f5e38ba5e97fde" width="1920" height="879" data-path="assets/supabase-url.png" />
</Frame>

2. Copy the **Project URL**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-copy-url.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=0d365d28642c832d90525f9b20c83f46" width="1920" height="879" data-path="assets/supabase-copy-url.png" />
</Frame>

3. Go to [Integrations > Supabase](https://app.funnelfox.com/integrations/supabase) in FunnelFox.
4. Paste the URL into the **Supabase Project URL** field.

<Frame>
  <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-url-paste.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=271f185b211f5660d9167861c329ce95" width="1920" height="879" data-path="assets/supabase-url-paste.png" />
</Frame>

5. Go back to your Supabase project and copy the **Publishable Key**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-copy-key.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=70b8e8049ec0c7dc6fe992467b344e59" width="1920" height="879" data-path="assets/supabase-copy-key.png" />
</Frame>

6. Paste the key into the **Supabase API Key** field in FunnelFox.

<Frame>
  <img src="https://mintcdn.com/funnelfox/etQJPZ8_iK7z7OUN/assets/supabase-key-paste.png?fit=max&auto=format&n=etQJPZ8_iK7z7OUN&q=85&s=96edd7225ee9462480c40343b10e5bb8" width="1920" height="879" data-path="assets/supabase-key-paste.png" />
</Frame>

7. Click **Save changes**.

<Check>You successfully integrated Supabase! Add the authentication methods you've set up to your funnels in the Editor.</Check>

## Add authentication to funnels

Once Supabase is configured, you can add authentication flows to your funnels in the Editor: prompt [AI Chat in Editor](/agentic-solution/overview#ai-chat-in-editor) or build the screens manually on the canvas. The following authentication methods correspond to the ones you've set up in Supabase.

The same OAuth buttons serve both authentication methods: sign up and sign in.

### Email/Password authentication

Enable users to authenticate with their email address and custom password.

To add Email/Password authentication to your funnel, prompt the AI Chat in Editor to add a screen for user registration with both **Email** and **Password** inputs.

Or go to **Add element > Inputs** and them manually.

<Note>By default, FunnelFox generates a random password when a user submits their email in the funnel. It's important to add the Password input on the same screen to replace the previously generated password with the one provided.</Note>

<Frame>
  <img src="https://mintcdn.com/funnelfox/L47wD8zMSLm8zhO6/assets/supabase-add-auth.png?fit=max&auto=format&n=L47wD8zMSLm8zhO6&q=85&s=9519438622d342bc2eb38676045d04ab" width="1165" height="904" data-path="assets/supabase-add-auth.png" />
</Frame>

### OAuth authentication

Enable seamless OAuth authentication using Google or Apple accounts for a frictionless user experience.

To add OAuth authentication to your funnel:

1. In the Editor, prompt the AI Chat to add a screen for user registration with OAuth button or use the one you've already added for Email/Password.

   Or click **Add element > Authentication** and select **OAuth button**.

2. Go to the **Parameters** tab of the OAuth button.

3. Select OAuth provider.

4. Under **Actions**, set up user navigation for cases when authentication succeeds or fails.

Learn more about setting up [navigation actions](/editor/actions#navigate).

<Frame>
  <img src="https://mintcdn.com/funnelfox/L47wD8zMSLm8zhO6/assets/supabase-oauth.png?fit=max&auto=format&n=L47wD8zMSLm8zhO6&q=85&s=fcf89704c278a5c116585c6682d5d77b" width="1170" height="960" data-path="assets/supabase-oauth.png" />
</Frame>
