# Local Development (https://auraimage.ai/docs/local-development)



AuraImage doesn't have a separate "dev mode" — every project is a real project on the production CDN. The recommended pattern is to **create a second project** for development and switch via env var. This assumes the [getting-started setup](/docs/getting-started) is done.

## Two-project pattern [#two-project-pattern]

Create two projects in the [dashboard](https://app.auraimage.ai):

| Environment | Project name | Base URL                               |
| ----------- | ------------ | -------------------------------------- |
| Production  | `my-app`     | `https://cdn.auraimage.ai/my-app/`     |
| Development | `my-app-dev` | `https://cdn.auraimage.ai/my-app-dev/` |

The names are arbitrary — pick whatever you want. They live in entirely separate storage, billing, and analytics namespaces; nothing leaks across.

Wire your environments to pick one or the other:

```bash title=".env.local"
NEXT_PUBLIC_AURA_PUBLIC_KEY=pk_...
AURA_SECRET_KEY=sk_live_...
NEXT_PUBLIC_AURA_PROJECT_NAME=my-app-dev
```

```bash title=".env.production"
NEXT_PUBLIC_AURA_PUBLIC_KEY=pk_...
AURA_SECRET_KEY=sk_live_...
NEXT_PUBLIC_AURA_PROJECT_NAME=my-app
```

`<AuraUploader project={...} />` and `<AuraImage src='${project}/file' />` will follow whichever value is set at build time. Same goes for any server code calling `aura.signUpload()`.

## Why not auto-switch? [#why-not-auto-switch]

Project names are baked into stored URLs (the `url` returned by upload includes the project name in its path). If the SDK silently switched namespaces based on `NODE_ENV`, links you persisted in dev would break in production. Making the choice explicit keeps your URL surface predictable.

## CI / staging [#ci--staging]

For preview deployments, point `NEXT_PUBLIC_AURA_PROJECT_NAME` at the dev project (or a third "staging" project) via your platform's env-var UI. The Secret Key is the same across all your projects on the same account — only the project name changes.

```yaml title=".github/workflows/preview.yml"
env:
  AURA_SECRET_KEY: ${{ secrets.AURA_SECRET_KEY }}
  NEXT_PUBLIC_AURA_PROJECT_NAME: my-app-dev
```

## Headless CLI logins [#headless-cli-logins]

`aura login` opens a browser by default. On a CI runner, SSH session, or container, the CLI auto-detects the headless environment and prints the verification URL with a short code. You can also force this explicitly:

```bash
aura login --no-browser
```

Open the URL on any device, sign in, and approve the code. Each `aura login` writes a fresh CLI session — list and revoke them from **Settings → CLI sessions** in the dashboard, where the [CLI session list](/docs/dashboard#cli-sessions) records each device and when it was last used.

## Cleaning up [#cleaning-up]

There is no automated dev-storage purge. If your dev project gets noisy, delete the project from the dashboard and recreate it — name reuse is allowed once a project is fully deleted.


## Related

- [Getting Started](https://auraimage.ai/docs/getting-started)
- [Upload Flow](https://auraimage.ai/docs/upload)
- [Dashboard](https://auraimage.ai/docs/dashboard)