Vercel
Since v0.22.0+Deploy Hot Updater server to Vercel with serverless functions.
Prerequisites
- Vercel account at vercel.com
- PostgreSQL database (Vercel Postgres, Supabase, or Neon)
- Cloud storage (S3, R2, Supabase, Firebase, or custom)
Installation
Install required dependencies.
npm install @hot-updater/server honoInstall your chosen storage plugin separately (e.g., @hot-updater/aws, @hot-updater/supabase, @hot-updater/firebase).
Install Drizzle ORM with PostgreSQL driver.
npm install drizzle-orm @vercel/postgresnpm install -D drizzle-kitDatabase Setup
Create the database connection file.
import { drizzle } from "drizzle-orm/vercel-postgres";
import { sql } from "@vercel/postgres";
export const db = drizzle(sql);Hot Updater Configuration
Create the Hot Updater instance.
import { createHotUpdater } from "@hot-updater/server";
import { drizzleAdapter } from "@hot-updater/server/adapters/drizzle";
import { db } from "./drizzle";
export const hotUpdater = createHotUpdater({
database: drizzleAdapter({ db, provider: "postgres" }),
storages: [
// Configure your storage plugin - examples:
// s3Storage({ /* S3 or R2 config */ }),
// supabaseStorage({ /* Supabase config */ }),
// firebaseStorage({ /* Firebase config */ }),
// myCustomStorage({ /* custom config */ }),
],
basePath: "/hot-updater",
});Serverless Function
Create Vercel serverless function with Hono.
import { Hono } from "hono";
import { hotUpdater } from "./hotUpdater";
const app = new Hono();
app.mount("/hot-updater", hotUpdater.handler);
export default app;With Hono mount(), leave /hot-updater/app-version/* and /hot-updater/fingerprint/* public for update checks. /hot-updater/version is mounted by default for diagnostics, so leave it public or disable it with routes.version: false. Protect /hot-updater/api/* when bundle routes are enabled.
Schema Generation
Generate the Drizzle schema for Hot Updater tables.
npx hot-updater db generate src/hotUpdater.ts --yesDevelopment
Run the development server locally.
npx vercel devServer runs at http://localhost:3000.
Deploy
Deploy to Vercel.
npx vercel deploy --prodYour Hot Updater server will be available at https://your-project.vercel.app/hot-updater.
CLI Configuration
Configure your CLI to use this deployed server.
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({
/* your config */
}),
database: standaloneRepository({
baseUrl: "https://your-project.vercel.app/hot-updater",
}),
});The storage plugin must match the storages in your server's createHotUpdater.