SDK (Beta)Overview

Aerostack SDK

⚠️

Beta — The Aerostack SDK is in active beta. APIs may change between minor versions. Pin your dependency versions for production use.

One package. Every backend service. Install the Aerostack SDK and get instant access to authentication, database, realtime pub/sub, file storage, AI completions, caching, queues, and vector search — all through a single, consistent API.

No stitching together five different services. No managing credentials for each one. One SDK, one provider, one project.

What is included

ModuleWhat it doesReact HookServer SDK
AuthRegistration, login, OTP, magic links, password reset, profile managementuseAuth()sdk.auth
DatabaseSQL queries, parameterized inserts, batch transactionsuseDb()sdk.db
RealtimeWebSocket pub/sub, DB change events, presence tracking, message historyuseSubscription()sdk.realtime
StorageFile upload, CDN URLs, metadata, copy/movesdk.storage
AIChat completions with 30+ models, streaming responsesuseAI(), useGatewayChat()sdk.ai
Vector SearchSemantic search, embeddings, RAG pipelinesuseVectorSearch()sdk.ai.search
CacheKey-value storage with TTL, counters, bulk operationssdk.cache
QueueBackground jobs with retries, delays, status trackingsdk.queue

Install

npm install @aerostack/react

Provider setup (React)

Wrap your application once. Every hook and component below it has access to all Aerostack services.

import { AerostackProvider } from '@aerostack/react'
 
function App() {
  return (
    <AerostackProvider
      projectId="proj_abc123"
      apiKey="pk_live_..."
      baseUrl="https://api.aerostack.dev/v1"
    >
      <YourApp />
    </AerostackProvider>
  )
}

The apiKey is your public project key, safe to include in client-side code. Never use your admin or secret key in the browser.

Server SDK setup (Node.js)

import { AerostackClient } from '@aerostack/sdk'
 
const client = new AerostackClient({
  projectId: process.env.PROJECT_ID,
  apiKey: process.env.API_KEY,
  baseUrl: 'https://api.aerostack.dev/v1',
})
 
const { sdk, realtime } = client

What you can build

Build complete authentication flows in minutes. Email/password registration, passwordless OTP for mobile apps, magic link login for frictionless onboarding, email verification, password reset, and profile management with avatars. Supports Cloudflare Turnstile bot protection out of the box.

Database — Product catalogs, user profiles, analytics dashboards

Full SQL access to your project’s database. Parameterized queries prevent injection. Batch operations run as atomic transactions — perfect for inventory updates, order placement, or any multi-step write. Query with RETURNING * to get inserted rows back without a second round-trip.

Realtime — Live chat, collaborative editing, presence, live dashboards

WebSocket channels with automatic reconnection. Subscribe to database table changes and get notified on every INSERT, UPDATE, or DELETE — no polling. Track who is online with presence. Persist messages for chat history. Build live auction bidding, collaborative document editing, multiplayer game state, or real-time analytics dashboards.

Storage — Avatars, documents, media galleries

Upload files to object storage with CDN-backed URLs. Manage metadata, copy files between paths, check existence. Build user avatar systems, document management, or media galleries with thumbnails.

AI — Chat completions, semantic search, RAG, content generation

Access 30+ LLM models through a unified API. Stream responses token-by-token for chat interfaces. Combine with vector search to build RAG pipelines that answer questions using your own data. Generate content, summarize documents, or classify text.

Cache — Session storage, rate limiting, feature flags

Sub-millisecond key-value storage at the edge. Set TTLs for automatic expiry. Use atomic counters for rate limiting or view counts. Bulk get/set for efficient batch operations. Store session data, feature flags, or computed results.

Queue — Email sending, PDF generation, batch imports

Offload expensive work to background jobs with configurable retries and delays. Track job status and cancel pending work. Build email notification pipelines, PDF report generation, bulk CSV imports, or scheduled data processing.

Vector Search — Knowledge bases, recommendations, FAQ matching

Ingest documents as vector embeddings and query them with natural language. Build knowledge bases that find relevant articles by meaning, not keywords. Power product recommendations, FAQ auto-matching, or semantic code search.

How it compares

AerostackFirebaseSupabase
Install1 package1 package1 package
AuthBuilt inBuilt inBuilt in
DatabaseSQL (SQLite-compatible)NoSQL onlySQL (Postgres)
RealtimePub/sub + DB changes + presence + historyDB listeners onlyDB listeners + broadcast
StorageObject storage + CDNGCSS3-compatible
AI / LLMBuilt in (30+ models)Requires Vertex AI setupRequires pg_vector + external
Vector SearchBuilt inNot availableRequires extension
CacheBuilt in (key-value)Not availableNot available
QueueBuilt inCloud Tasks (separate)pg_cron (limited)
Edge RuntimeNative (Cloudflare Workers)Cloud FunctionsEdge Functions

Choose your runtime

SDK capabilities by runtime

FeatureReactNode.jsGoPythonFlutter
Auth (full)YesYesYesYesYes
Databasevia hooksYesYesYesPartial
RealtimeYesYesYesYesYes
StorageYesYesPartialYes
AI / LLMYesYesYesYesPartial
CacheYesYesYes
QueueYesPartialPartial
Vector SearchYesYesYesYes

React hooks call your server-side Logic Modules for database, cache, and queue operations. This keeps your API keys and SQL on the server. The server SDK (@aerostack/sdk) has direct access to all modules.