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

# Data, accounts and Newly Backend

> How your app stores data, and when the agent adds Newly Backend for accounts, shared data and server code.

Describe what you want your app to do, such as letting people sign in, save recipes or upload photos. The agent creates and connects the backend your app needs, and Newly hosts it for you.

**Newly Backend** is the built-in backend for new apps at app.newly.app. Apps that don't need a backend keep their data on the device.

> [!NOTE]
>
> Projects imported from the earlier Newly app with Liquid Backend keep their existing backend. This guide describes Newly Backend for new apps.

## Apps start local-first

By default, a new app saves its data on the phone. There are no accounts, no server and no sign-in, and there's nothing to host.

The agent adds a backend only when your app needs one, for example when you ask for:

* sharing data between people
* more than one user, or user accounts and sign-in
* syncing data across devices
* payments

If your request doesn't make it clear, the agent asks you one plain question first, such as whether other people should be able to sign in and see the same data. Answer in your own words.

> [!TIP]
>
> If you already know your app needs accounts, say so in your first message. For example: "People sign in with email and see their own saved recipes on any phone."

## What Newly Backend includes

When the agent adds Newly Backend, your project gets:

* **A sign-in service** for your app's users. Email and password sign-in work right away. See [Sign-in for your app](https://docs.newly.app/backend/app-sign-in.md).
* **An API service** for your app's own server code and endpoints.
* **A Postgres database** for each environment.
* **File storage** for each environment, for things like photos and uploads.

The first setup takes a few minutes. The agent sets up the backend, connects your app to it, and then tells you what your app can now do. You don't need to run anything yourself.

The backend code lives in the `backend/` folder of your project, next to your app code. Database changes are made through migrations, which the agent writes and applies for you.

## Dev and production

Newly Backend has two separate environments:

| Environment | Who changes it | Database and files |
| - | - | - |
| **Dev** | The agent, as it builds your app | Its own database and file storage |
| **Production** | You or a project **Admin**, in Settings or with the newly CLI | A separate database and file storage |

The agent only works on dev, and it connects your app to your dev backend. Data you create and files you upload while testing stay in dev and don't appear in production, and the dev backend can't read or change production's files. Shipping your backend to production is a step you take yourself, as the project's owner or a project **Admin**. See [Production and secrets](https://docs.newly.app/backend/production-and-secrets.md).

## See and edit your data

Open the **Database** tab in the sidebar.

| Who | Dev | Production |
| - | - | - |
| Project owner | View and edit | View |
| **Admin** | View and edit | No access |
| **Can edit** or **Can view** | No Database tab | No Database tab |

The owner switches between **Dev** and **Production** at the top. The tab lists the tables in that database, grouped by service, and shows a table's rows 50 at a time.

In **Dev** you can change data by hand:

* **Change a value:** click a cell, type the new value, and click **Save**. **Set NULL** empties it.
* **Add a row:** click **Add row**. A field you leave blank gets its default.
* **Delete rows:** tick them, click **Delete**, then confirm.

Changes save straight to the database. If a value doesn't fit its column, the database's own error shows under the field and nothing changes. Tables without a primary key and views can't be edited here.

**Production** is view-only in the Database tab. The owner can also use the CLI to export a connection URL for direct database access.

A table the agent adds shows up after the backend is deployed. Every table is listed, including your app's sign-in tables under **auth**, and you can edit them in Dev. Deleting someone from **auth.user** also signs them out everywhere.

Columns that hold a secret show as **hidden** and can't be read or changed here: session tokens, password hashes, sign-in tokens from Google or Apple, the key that signs logins, and verification codes. The same goes for any column in your own tables whose name ends in `password`, `secret`, `token`, `private_key` or `api_key`.

There's no log viewer in the app. If you're comfortable with a terminal, the newly CLI can help:

* `newly db url` prints a read-only address for your **dev** database, which you can open in a database tool.
* `newly db url --env prod --role owner` exports the **production** database owner's connection URL. Only the project owner can export it, and it contains a password.
* `newly logs` shows recent logs from your **dev** services.

Logs remain dev-only. See [Get your code](https://docs.newly.app/code/get-your-code.md) to install the tool and sign in, and [Database backups](https://docs.newly.app/backend/database-backups.md) for manual snapshots, your own scheduler and access during a Newly outage.

## Things to know

* **Background jobs:** background queue processing isn't available in Newly Backend.
* **Other backend providers:** Newly doesn't connect to Firebase or other backend providers. Newly Backend is the backend for Newly apps. If your app already uses Supabase, [connect your Supabase project](https://docs.newly.app/backend/integrations.md#supabase) and the agent deploys to it.
* **Email:** sign-up verification and password reset emails go out from your own domain once Newly has verified it for email. See [Sign-in for your app](https://docs.newly.app/backend/app-sign-in.md#emails-for-password-reset-and-verification). For other app emails and campaigns, see [Email your users](https://docs.newly.app/backend/email.md).

## Credits

Hosting Newly Backend doesn't draw down credits currently. The agent work that builds and changes your backend uses credits like any other agent work. See [How credits work](https://docs.newly.app/billing/how-credits-work.md).

You need a positive credit balance to create a Newly Backend. See [Running out of credits](https://docs.newly.app/billing/out-of-credits.md).

## Related

> [card] [Sign-in for your app](https://docs.newly.app/backend/app-sign-in.md)
>
> Email, Google and Apple sign-in for your app's users.

> [card] [Production and secrets](https://docs.newly.app/backend/production-and-secrets.md)
>
> Ship your backend to production and set API keys.

> [card] [Integrations](https://docs.newly.app/backend/integrations.md)
>
> Push notifications, payments and other services.

> [card] [Database backups](https://docs.newly.app/backend/database-backups.md)
>
> Manual snapshots, your own scheduler and direct database access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.