@aerostack/core
v0.8.13
Published
Shared types and RPC client for Aerostack SDKs
Readme
@aerostack/core
Shared core types, RPC client, and validation schemas for the Aerostack SDK ecosystem.
Note: This is an internal package. If you're building an application, use
@aerostack/node,@aerostack/react,@aerostack/web, or@aerostack/sdkinstead.
Installation
npm install @aerostack/coreWhat's Inside
RPC Client
The AerostackClient class provides the low-level HTTP transport used by all TypeScript SDKs:
import { AerostackClient } from '@aerostack/core';
const client = new AerostackClient({
baseUrl: 'https://your-project.aerostack.dev',
apiKey: 'your-api-key',
});Capabilities:
- Authenticated HTTP requests (API key and JWT)
- Multipart form data uploads (for storage)
- Consistent error handling across all operations
Service Namespaces
The RPC interface exposes the following service namespaces:
| Namespace | Operations |
|-----------|-----------|
| db | query, batch |
| cache | get, set, delete, list, keys, getMany, setMany, deleteMany, flush, expire, increment |
| queue | enqueue, getJob, listJobs, cancelJob |
| ai | chat, search.ingest, search.query, search.delete, search.configure, and more |
| storage | upload, get, getUrl, getMetadata, list, delete, exists, copy, move |
| services | invoke |
| auth | signup, signin |
| collections | list, get, create, update, delete |
| ecommerce | config, products, categories, cart |
Type Definitions
Exports TypeScript interfaces used across all SDKs:
import type { User, Project, Product, Order, Cart, Job } from '@aerostack/core';Available types: User, Project, Component, Page, Product, ProductVariant, Order, Cart, CartItem, Customer, Job, Collection, Store, Category, StorageObject, CacheKeyEntry, and more.
Validation Schemas
Zod-based validation for registry configuration:
import { validateRegistryConfig, safeValidateRegistryConfig } from '@aerostack/core/schemas/registry';
const result = safeValidateRegistryConfig(config);
if (!result.success) {
console.error(result.error.issues);
}Build
npm run build # Compiles with tscThis package must be built before all other TypeScript SDKs in the monorepo.
Related Packages
| Package | Description |
|---------|-------------|
| @aerostack/node | Node.js SDK for server-side applications |
| @aerostack/web | Browser SDK for client-side applications |
| @aerostack/react | React hooks for Aerostack services |
| @aerostack/sdk | Universal SDK for Cloudflare Workers + Browser |
| @aerostack/react-native | React Native SDK for mobile apps |
License
MIT
