AuraImage

Getting Started

Get AuraImage running in your project in under 5 minutes.

Prerequisites

  • Node.js 18+
  • An AuraImage account and API key pair

Install the CLI

npm install -g @auraimage/cli

Initialize Your Project

Running aura init in your project root creates an aura.config.json with your project slug and keys, and writes the correct environment variables to .env.local.

aura init

You will be prompted for:

  • Your Public Key (safe to expose in frontend code)
  • Your Secret Key (stays in your backend / CI only)
  • Your project slug (public-facing, e.g. narek)

The resulting aura.config.json:

{
  "slug": "narek",
  "publicKey": "pk_live_...",
  "devSlug": "dev-narek",
  "baseUrl": "https://auraimage.ai"
}

Authentication: Dual-Key System

AuraImage separates concerns between frontend and backend:

KeyWhere to useWhat it does
Public Key (pk_*)Frontend, Shadcn componentIdentifies your project for read/display requests
Secret Key (sk_*)Backend, MCP server, CI/CDSigns upload requests via HMAC — never expose in client code

Environment Variables

.env.local
NEXT_PUBLIC_AURA_PUBLIC_KEY=pk_live_...
AURA_SECRET_KEY=sk_live_...
AURA_SLUG=narek

Your First Upload

1. Generate a signature (server-side)

import { AuraImage } from '@auraimage/sdk';

const aura = new AuraImage({ secretKey: process.env.AURA_SECRET_KEY });

const signature = aura.signUpload({
  slug: 'narek',
  maxSize: '5mb',
  expires: Date.now() + 3600_000,
});

2. Upload from the client

const formData = new FormData();
formData.append('file', file);

const response = await fetch('https://api.auraimage.ai/v1/upload', {
  method: 'POST',
  headers: { 'X-Aura-Signature': signature },
  body: formData,
});

const { url } = await response.json();
// url → "https://auraimage.ai/narek/hero-image.avif"

3. Use the URL

<img src="https://auraimage.ai/narek/hero-image.jpg?w=800&fmt=auto" alt="Hero" />

Or use the <AuraImage /> component for automatic Triple-Stage Loading — see Components.

Next Steps