Skip to content

Local Development

Keep dev uploads out of your production storage and analytics.

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.

Two-project pattern

Create two projects in the dashboard:

EnvironmentProject nameBase URL
Productionmy-apphttps://cdn.auraimage.ai/my-app/
Developmentmy-app-devhttps://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:

.env.local
NEXT_PUBLIC_AURA_PUBLIC_KEY=pk_...
AURA_SECRET_KEY=sk_live_...
NEXT_PUBLIC_AURA_PROJECT_NAME=my-app-dev
.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.jpg' /> will follow whichever value is set at build time. Same goes for any server code calling aura.signUpload().

Why not auto-switch?

Project names are baked into stored URLs (the key returned by upload includes the project in its CDN URL). 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

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.

.github/workflows/preview.yml
env:
  AURA_SECRET_KEY: ${{ secrets.AURA_SECRET_KEY }}
  NEXT_PUBLIC_AURA_PROJECT_NAME: my-app-dev

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:

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.

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.