Setup
Get OtaKit running in your Capacitor project. You'll need an OtaKit account — sign up free at the dashboard.
1. Install the Capacitor plugin
npm install @otakit/capacitor-updater npx cap sync
2. Configure the plugin
Add the Updater plugin to your capacitor.config.ts. You'll get your appId and publicKey when you register an app in step 4.
// capacitor.config.ts
import type { CapacitorConfig } from "@capacitor/cli";
const config: CapacitorConfig = {
appId: "com.example.myapp",
appName: "My App",
webDir: "out",
plugins: {
Updater: {
appId: "YOUR_APP_ID",
publicKey: "YOUR_PUBLIC_KEY",
defaultChannel: "default",
updateMode: "silent",
autoUpdate: true,
appReadyTimeout: 10000
}
}
};
export default config;3. Add notifyAppReady()
Call notifyAppReady() once your app has loaded. If this isn't called within appReadyTimeout (default 10s), the plugin rolls back to the previous bundle.
import { Updater } from "@otakit/capacitor-updater";
// Call once your app is fully loaded
await Updater.notifyAppReady();For frameworks like React/Next.js, wrap it in a useEffect:
"use client";
import { useEffect } from "react";
import { Updater } from "@otakit/capacitor-updater";
import { Capacitor } from "@capacitor/core";
export function AppReadyProvider({ children }: { children: React.ReactNode }) {
useEffect(() => {
if (Capacitor.isNativePlatform()) {
Updater.notifyAppReady();
}
}, []);
return <>{children}</>;
}4. Install the CLI and register your app
npm install -g @otakit/cli
Set your API key (find it in the Organization tab of the dashboard):
export OTAKIT_SECRET_KEY=otakit_sk_...
Set your API URL (managed or self-hosted server):
export OTAKIT_SERVER_URL=https://your-domain.com
Register your app. The slug should match your Capacitor app identifier:
otakit register --slug com.example.myapp
Copy the returned appId and publicKey into your capacitor.config.ts plugin config from step 2, then export OTAKIT_APP_ID for CLI commands.
export OTAKIT_APP_ID=your-app-id
5. Upload and release
Build your web assets, then:
otakit upload otakit release
upload reads the bundle path from webDir in your Capacitor config (or OTAKIT_BUILD_DIR), reads the version from package.json, and uploads a single cross-platform bundle.
release releases the latest bundle to the default channel. Override with --channel staging.
That's it. Relaunch the app on your device and it will pick up the update. See the CLI reference for all options, or the full walkthrough for a step-by-step guide from scratch.