> For the complete documentation index, see [llms.txt](https://docs.thunkable.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thunkable.com/ai/features/cloud-database.md).

# Cloud Database

## Overview

Thunkable Cloud DB is the behind-the-scenes backbone that powers apps built with Thunkable AI. It handles user login and stores your app's data automatically with Supabase. When you describe the app you want to build, the AI will suggest how to organize your data, and you can approve it right in the chat. Your app will then be able to read and write data in real time as people use it. From there, anyone using your app can create an account and sign in with their email and password.

## Video Tutorial

{% embed url="<https://www.youtube.com/watch?v=Smb4uMn8EDE>" %}

## Getting Started

### Step 1: Connect Your Supabase Account

Before you can use Thunkable Cloud, you'll need a free Supabase account. Supabase is where your app's data will live.<br>

1. Go to [supabase.com](https://supabase.com) and create a free account if you don't have one
2. In Thunkable AI, access your Cloud Database in your [account settings](https://ai.thunkable.com/account/supabase) or by clicking on the dropdown next to your profile, then selecting 'Cloud Database'.

<figure><img src="https://1781702014-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCI51jzBbSRAMaZWD1kx4%2Fuploads%2F0MSF71D4qM9RPFIkxoxh%2Fimage.png?alt=media&#x26;token=68c8f633-99ac-4010-871e-2fc721d769e3" alt="" width="300"><figcaption></figcaption></figure>

3. Choose how to connect:

{% tabs %}
{% tab title="OAuth2 (recommended) " %}

<figure><img src="https://1781702014-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCI51jzBbSRAMaZWD1kx4%2Fuploads%2FzCrvGPLyNgaZwxBlwABP%2FScreenshot%202026-05-27%20at%202.24.32%E2%80%AFPM.png?alt=media&#x26;token=307b86b8-ae02-46fd-963f-115f7a286e55" alt="" width="563"><figcaption></figcaption></figure>

1. Click 'Sign in with Supabase' to navigate to the Supabase website to connect with Thunkable
2. Select the Organization to connect to, then click 'Authorize Thunkable'
   {% endtab %}

{% tab title="Personal Access Token" %}

<figure><img src="https://1781702014-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCI51jzBbSRAMaZWD1kx4%2Fuploads%2FFdDpgsSAkbCga9uFqScM%2FScreenshot%202026-05-27%20at%202.24.42%E2%80%AFPM.png?alt=media&#x26;token=81ab6362-93e1-4ce5-938a-228fe6931d18" alt="" width="563"><figcaption></figcaption></figure>

1. Generate a token at [supabase.com/dashboard/account/tokens](https://supabase.com/dashboard/account/tokens)

2. Paste it in Thunkable and then click 'Save'
   {% endtab %}
   {% endtabs %}

3. You'll see a green status indicator when the connection is active.

<figure><img src="https://1781702014-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCI51jzBbSRAMaZWD1kx4%2Fuploads%2FRz2xwz82zRaDY4alyo6A%2Fimage.png?alt=media&#x26;token=482bc140-c87e-47a1-9062-c16b2c2af197" alt="" width="563"><figcaption></figcaption></figure>

### Step 2: Start a Project with Cloud Database

1. Create a new project in Thunkable AI and switch to [Plan Mode](https://aidocs.thunkable.com/#input-options)
2. In your prompt, include the following dependant on the feature you want to add:

{% tabs %}
{% tab title="Auth (Sign-in and Sign-out)" %}

```
Add User Authentication with User Sign-up and Sign-in through the Cloud Database with Supabase
```

When prompted with such questions as 'How should people sign in?', it is recommended to select 'Email only'.

{% hint style="warning" %}
There are many other sign-in methods that Supabase offers, such as Google Auth, but they may not be functional on Thunkable or may require additional external setup.
{% endhint %}
{% endtab %}

{% tab title="Data Storage" %}

```
Save the data in the Cloud Database with Supabase.
```

When prompted with such questions as 'How should the entries be stored?', select 'Cloud
{% endtab %}
{% endtabs %}

The first time you use Cloud on a project, Thunkable AI sets up a dedicated database in your Supabase account. This takes about 2 minutes. A progress card in chat will keep you updated. To use a database one of your other apps already has instead, see [Share a Database Between Apps](#share-a-database-between-apps).

## What Your Users See When They Sign Up

When someone signs up for your app with their email, Supabase sends them a confirmation link. Clicking it takes them to a Thunkable confirmation page showing your app's name and icon, so they know the link worked and which app it belongs to.

| What happened                | What they see                                 |
| ---------------------------- | --------------------------------------------- |
| Email confirmed              | **You're all set**                            |
| Password reset link opened   | A prompt to continue resetting their password |
| Link expired or already used | **This link has expired**                     |
| Page opened directly         | **Nothing to do here**                        |

Expired and failed links don't show your app's name or icon — the link no longer carries enough information to identify your app.

### Sending Users to Your Own Page Instead

Your Supabase project belongs to your own Supabase account, so you can change where these links go.

In the Supabase dashboard, open Authentication → URL Configuration:

1. Add your own domain under 'Redirect URLs', then pass it as `emailRedirectTo` when signing a user up, or `redirectTo` on a password reset
2. Or replace 'Site URL' to send every default redirect to a page you control

Thunkable sets the Site URL once, when it first creates your project, and after that only ever adds to the Redirect URLs list. Your own changes stay as you left them.

{% hint style="info" %}
Apps with a Cloud database created before release v575 (October 2026) keep their original settings. To use the confirmation page, set your Site URL to `https://ai.thunkable.com/auth/complete` in the Supabase dashboard.
{% endhint %}

## Review and Approve Schema Changes

When your app needs to store data, Thunkable AI will propose a database change in chat before applying anything.<br>

1. A schema card will appear in chat describing the proposed change — for example, "Add a Habits table with Title and Streak fields"
2. Review the proposed tables, columns, and permissions
3. Click Apply to save the change to your database, or Cancel to skip it

If you send a new prompt instead of clicking Apply or Cancel, the proposed change is cancelled and the card reads "Database change cancelled". Your database is not modified. Ask the AI again if you still want the change.

<figure><img src="https://1781702014-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCI51jzBbSRAMaZWD1kx4%2Fuploads%2FxCnUksYxHMhHBCnMfA1b%2Fimage.png?alt=media&#x26;token=a9bc78b5-3507-495a-b7e0-2ac3d3da2bd5" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="danger" %}
Schema changes are permanent in V1. Once applied, they can't be removed from version history. You can always add new tables and columns, but renaming or deleting isn't supported yet.
{% endhint %}

## Share a Database Between Apps

Several of your apps can use the same database. For example, a customer app and an admin app can both read and write the same orders. Apps linked to the same database share its tables and its signed-up users.

### Link a New App to an Existing Database

1. On the Thunkable AI home page, open the **Database** menu in the prompt box.
2. Select **Link existing database**.
3. Choose a database from the list. The list shows the databases in your Supabase account that were created by your Thunkable apps, with the apps already using each one and its number of tables.
4. Optionally, enter a **Table prefix**. New tables created by this app are named with the prefix, for example `admin_orders`. Existing tables keep their names.
5. Click **Link database**.

The Database menu now reads **Linked to** followed by the database name. Submit your prompt as usual.

### Link an Existing App

To move an app that stores its data on the device to a shared database:

1. Add the **Cloud Database** integration from the [Integrations](https://aidocs.thunkable.com/features/integrations) panel.
2. In the **Database** field, choose an existing database instead of **Create a new database**.

### Sign-in on a Shared Database

Sign-in belongs to the database, so every app linked to it uses the same sign-in method. When you link an app, Thunkable AI shows the method the other apps use instead of asking you to choose one.

### Tables With the Same Name

If a table your app needs has the same name as a table already in the database, choose one of the following for each table:

* **Share with** the other app — both apps read and write the same rows.
* **Keep separate** — the table is created under a different name.

If the existing table is missing a column your app needs, Thunkable AI tells you that this app won't save that column.

### The Database Tab on a Linked App

Click **Database** in the toolbar to see your app's tables. On a linked app:

* The header shows **Shared with** and the names of the other apps, along with the table prefix. Click **Edit prefix** to change it.
* A table that another app uses shows a **Used in** label with that app's name.

Every linked app can see and change every table in the database.

{% hint style="warning" %}
A change to a shared table affects every app linked to the database.
{% endhint %}
