> 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, and any file storage (see [Let Users Upload Files](#let-users-upload-files))
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 %}

## Let Users Upload Files

Your app can let the people who use it upload files, such as a photo of each receipt or a PDF on each deal. Ask for it in chat, for example:

```
Let people attach a photo of each receipt
```

Thunkable AI proposes file storage for the uploads, along with a column that records each file, on the same schema card as table changes. The card is marked **New file storage** and sums it up, for example **Private · up to 10 MB · Images**. Click Apply to add it.

Unless you ask for something else, new file storage is:

* **Private** — a file opens only for the people its permissions allow.
* Limited to files up to 10 MB.
* Owned by the uploader — only the person who uploaded a file can open, replace or delete it.

Only signed-in users can upload files. If your app has no sign-in yet, the same change turns it on.

To change any of this, ask in chat. For example, make profile pictures public, let any signed-in user open the files, accept videos, or allow bigger files. The change comes back on a schema card marked **Changed file storage** or **File permission update** for you to approve. If you ask for files over 10 MB, the card warns that big files use up your Supabase storage fast and upload slowly on mobile data.

If you ask for uploads in the prompt that creates your app, Thunkable AI builds the rest of the app first. Ask for the uploads in chat afterwards to add the file storage.

To see your app's file storage, click **Database** in the toolbar. The **Files** section lists each one with **Private** or **Public**, its size limit, the kinds of files it accepts, and who can open, upload, replace and delete files. To browse the files people uploaded, choose **Uploaded files** from the **Open in Supabase** menu.

{% hint style="warning" %}
File storage can't be removed or renamed, or switched between private and public, once it's applied.
{% 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**.

### Copies of a Cloud Database App

When you open a copy of someone else's cloud app, for example from a share link or with **Make a Copy**, the copy doesn't come with a database. The original app's database stays with its owner. The chat shows **Choose where this app keeps its data**, and the preview waits until you choose:

1. Choose one of the databases in your Supabase account, or keep **Create a new database** to start with a new, empty one. A database an earlier copy of the same app uses is marked **Suggested**.
2. If you chose an existing database, the card shows what linking does: the tables that are **Already there**, the tables and columns it **Adds**, and the database's own rules it keeps. Nothing already in the database is removed or changed.
3. Click **Use this database** or **Create database**.

If you haven't connected Supabase yet, click **Connect Supabase** first.

If a column has a different type in the database than in the app, the card says the app can't use that database. When the app can work with the database's type instead, click **Resolve conflict** and choose in chat to change the column to the database's type, or keep the app's type and pick another database.

When you duplicate one of your own cloud apps, the **Duplicate** dialog asks where the copy keeps its data:

* **Share the same database** — both apps read and write the same tables.
* **Set up a new database** — the copy gets a separate database with the same tables but no data.
* **Use another of your databases** — the copy goes on one of your existing databases. Tables and columns it's missing are added; nothing already there changes. This option appears only when you have other databases.

### 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.

### Choose Who Can Sign In to Each App

Apps linked to the same database share its signed-up users, so by default anyone with an account can sign in to any of them. For example, a customer of your store app could also sign in to your admin app. To limit an app to users with a certain role:

1. Open the app and click **Database** in the toolbar.
2. Under **Who can sign in**, choose **Only users with role** followed by the role, for example **Only users with role “admin”**.

To remove the limit, choose **Anyone with an account**.

The roles you can choose are the ones your database's permissions already use. If none of your database's permissions check a user's role, the setting doesn't appear. Only the project owner can change it, and only from the Database tab; the AI can't change it for you.

When someone without the role tries to sign in, the app shows **This account can't sign in to this app**. They stay signed in to your other apps on the same database. If you take a role away from someone who is already signed in, it applies the next time their session refreshes or they reopen the app.

The setting applies in Preview, in Live Test, in your published web app and in your downloaded or published mobile apps.

{% hint style="warning" %}
Mobile apps pick up this setting when they are built. After you change it, download or publish your app again so installed copies use the new setting. Your published web app updates on its own.
{% endhint %}

{% hint style="info" %}
This setting only decides who can sign in to this app. What a signed-in user can read or change is still controlled by your table permissions.
{% endhint %}

### 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 %}
