Skip to Content
OperationsConfiguration

Configuration

Music API environment

VariableDefaultUsed for
PORT4175TCP port; server listens on 0.0.0.0
NGAMIA_API_BASE_URLhttp://localhost:8080Ngamia API origin; trailing slash is removed
CAMEL_ACCOUNTS_URLhttps://accounts.camelcreatives.comServer-side OAuth token endpoint base
CAMEL_ACCOUNTS_CLIENT_IDngamia_webToken exchange client ID
CAMEL_ACCOUNTS_REDIRECT_URIhttp://localhost:4174/auth/callbackExact redirect URI sent to Camel token endpoint
ALLOWED_ORIGINShttps://app.ngamia.com,http://localhost:4174Comma-separated exact browser origins
NODE_ENVRuntime valueEnables Secure cookies only when production

The service loads .env.local first and then .env through dotenv. MUSIC_STORAGE_DIR is not part of this NestJS service’s .env.example; the Ngamia API owns audio storage configuration.

Web application variables

VariableDefault / exampleUsed for
NEXT_PUBLIC_API_URLLocal http://localhost:4175, production https://api.ngamia.comBrowser-facing Music API origin
NEXT_PUBLIC_CAMEL_ACCOUNTS_URLhttps://accounts.camelcreatives.comOAuth authorization page
NEXT_PUBLIC_CAMEL_ACCOUNTS_CLIENT_IDngamia_webOAuth authorize request
NEXT_PUBLIC_CAMEL_ACCOUNTS_REDIRECT_URI${window.location.origin}/auth/callbackRegistered callback URI

The same OAuth client ID and redirect URI must be used in the web authorization request and the backend code exchange. Do not prefix server-only settings with NEXT_PUBLIC_; public-prefixed values are embedded into browser code.

Production checklist

  1. Set NGAMIA_API_BASE_URL to the reachable Ngamia API origin, without an API path suffix.
  2. Set the production Camel Accounts URL, client ID, and exact callback URL (https://app.ngamia.com/auth/callback).
  3. Set ALLOWED_ORIGINS=https://app.ngamia.com (add other exact trusted origins only when required).
  4. Set the web app’s NEXT_PUBLIC_API_URL=https://api.ngamia.com and matching OAuth values.
  5. Serve the API over HTTPS so cookies are marked Secure.
  6. Verify web/API cookie behavior in supported browsers and confirm the Ngamia API is reachable from the deployment runtime.

The API parses JSON and URL-encoded request bodies up to 2 MB. Generation prompts have a stricter route-level limit of 4,100 characters.

See origins and cookies and deployment.

Last updated on