CLI Configuration
Since v0.22.0+Configure your Hot Updater CLI to connect to your self-hosted server.
Overview
Your CLI configuration (hot-updater.config.ts) connects your React Native project to your self-hosted Hot Updater server. This file defines how bundles are built, stored, and tracked.
Basic Configuration
Create a hot-updater.config.ts file in your React Native project root:
import { defineConfig } from "@hot-updater/core";
import { bare } from "@hot-updater/bare";
import { s3Storage } from "@hot-updater/aws";
import { standaloneRepository } from "@hot-updater/standalone";
export default defineConfig({
build: bare(),
storage: s3Storage({
region: "auto",
endpoint: process.env.R2_ENDPOINT,
credentials: {
accessKeyId: process.env.R2_ACCESS_KEY_ID!,
secretAccessKey: process.env.R2_SECRET_ACCESS_KEY!,
},
bucketName: process.env.R2_BUCKET_NAME!,
}),
database: standaloneRepository({
baseUrl: "http://localhost:3000/hot-updater",
}),
});Critical: Storage Plugin Must Match
The storage plugin in your CLI config must match the storages in your server's createHotUpdater configuration.
CLI uses s3Storage → Server must use s3Storage
Both sides need the same plugin type and configuration to encode/decode storage URIs correctly.
Standalone Repository Configuration
The standaloneRepository plugin connects your CLI to your self-hosted server:
interface StandaloneRepositoryConfig {
baseUrl: string; // Your server URL
commonHeaders?: Record<string, string>; // Optional headers (e.g., authentication)
routes?: Routes; // Optional custom route configuration
}Basic Example
database: standaloneRepository({
baseUrl: "http://localhost:3000/hot-updater",
})With Authentication
database: standaloneRepository({
baseUrl: process.env.HOT_UPDATER_SERVER_URL!,
commonHeaders: {
"Authorization": `Bearer ${process.env.API_TOKEN}`
}
})With Custom Routes
database: standaloneRepository({
baseUrl: "https://api.example.com",
routes: {
upsert: () => ({
path: "/v1/hot-updater/api/bundles",
headers: { "X-Custom-Header": "value" }
}),
list: () => ({
path: "/v1/hot-updater/api/bundles"
}),
retrieve: (bundleId) => ({
path: `/v1/hot-updater/api/bundles/${bundleId}`
}),
delete: (bundleId) => ({
path: `/v1/hot-updater/api/bundles/${bundleId}`
})
}
})API Endpoints
Your server must implement these endpoints (when using default routes):
| Method | Endpoint | Description |
|---|---|---|
| POST | /hot-updater/api/bundles | Create or update bundles |
| GET | /hot-updater/api/bundles | List bundles (query: channel, platform, limit, offset) |
| GET | /hot-updater/api/bundles/:id | Get bundle by ID |
| DELETE | /hot-updater/api/bundles/:id | Delete bundle |
| GET | /hot-updater/api/bundles/channels | List all channels |
These endpoints are automatically created when you use @hot-updater/server with database adapters.
Next Steps
Choose your build and storage plugins:
- Build Plugins - React Native CLI, Expo, Re.Pack
- Storage Plugins - AWS S3, Supabase, Firebase, Cloudflare R2
Set up your server:
- Quick Start Guide - Set up a server in 5 minutes
- Database Adapters - Drizzle, Prisma, Kysely, MongoDB
- Server Frameworks - Hono, Express, Elysia
- Overview - Learn about the architecture