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
| Module | What it does | React Hook | Server SDK |
|---|---|---|---|
| Auth | Registration, login, OTP, magic links, password reset, profile management | useAuth() | sdk.auth |
| Database | SQL queries, parameterized inserts, batch transactions | useDb() | sdk.db |
| Realtime | WebSocket pub/sub, DB change events, presence tracking, message history | useSubscription() | sdk.realtime |
| Storage | File upload, CDN URLs, metadata, copy/move | — | sdk.storage |
| AI | Chat completions with 30+ models, streaming responses | useAI(), useGatewayChat() | sdk.ai |
| Vector Search | Semantic search, embeddings, RAG pipelines | useVectorSearch() | sdk.ai.search |
| Cache | Key-value storage with TTL, counters, bulk operations | — | sdk.cache |
| Queue | Background jobs with retries, delays, status tracking | — | sdk.queue |
Install
npm install @aerostack/reactProvider 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 } = clientWhat you can build
Auth — SaaS login, mobile OTP, magic links
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
| Aerostack | Firebase | Supabase | |
|---|---|---|---|
| Install | 1 package | 1 package | 1 package |
| Auth | Built in | Built in | Built in |
| Database | SQL (SQLite-compatible) | NoSQL only | SQL (Postgres) |
| Realtime | Pub/sub + DB changes + presence + history | DB listeners only | DB listeners + broadcast |
| Storage | Object storage + CDN | GCS | S3-compatible |
| AI / LLM | Built in (30+ models) | Requires Vertex AI setup | Requires pg_vector + external |
| Vector Search | Built in | Not available | Requires extension |
| Cache | Built in (key-value) | Not available | Not available |
| Queue | Built in | Cloud Tasks (separate) | pg_cron (limited) |
| Edge Runtime | Native (Cloudflare Workers) | Cloud Functions | Edge Functions |
Choose your runtime
SDK capabilities by runtime
| Feature | React | Node.js | Go | Python | Flutter |
|---|---|---|---|---|---|
| Auth (full) | Yes | Yes | Yes | Yes | Yes |
| Database | via hooks | Yes | Yes | Yes | Partial |
| Realtime | Yes | Yes | Yes | Yes | Yes |
| Storage | — | Yes | Yes | Partial | Yes |
| AI / LLM | Yes | Yes | Yes | Yes | Partial |
| Cache | — | Yes | Yes | Yes | — |
| Queue | — | Yes | Partial | Partial | — |
| Vector Search | Yes | Yes | Yes | Yes | — |
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.