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

{% hint style="warning" %}
Thunkable Cloud is available to Accelerator or above.
{% endhint %}

## 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="/files/WLcHxAwKLCHrsVuvdImA" alt="" width="300"><figcaption></figcaption></figure>

3. Choose how to connect:

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

<figure><img src="/files/Zd3L07weEDkGjaO20oCv" 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="/files/z53OutfMKiuzVrizgBRm" 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="/files/XewQgBn38pVmtIZS9Swk" 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.&#x20;

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

<figure><img src="/files/QrYpEQv31d5mbhxTiK6i" 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 %}

## Managing Your Connection

### If Your Connection Goes Red

If your Supabase connection expires or is revoked:

1. Go to Account Settings → Supabase
2. Paste a new Personal Access Token, or click Connect via OAuth2 to re-authenticate
3. Your connection will restore automatically — no need to disconnect first

Your published apps are not affected by a disconnected Supabase connection. They continue running independently.

### Disconnecting Supabase

1. Go to Account Settings → Supabase
2. Click Disconnect
3. Confirm the prompt

Disconnecting removes Thunkable AI's access to manage your databases. Your Supabase projects and all data remain in your account, untouched.

<br>

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.thunkable.com/ai/features/cloud-database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
