Plugin System

The Hot Updater is designed to be highly customizable through its plugin system. This extensibility allows you to tailor the updater's behavior to fit your specific requirements.

Build Plugin

The Build Plugin is used during the execution of the hot-updater deploy command. Its primary function is to manage the build process for generating the required update bundles.

Supported Plugins

  • @hot-updater/metro: Supports Metro bundler for React Native projects.
  • @hot-updater/repack: Coming soon.

Storage Plugin

The Storage Plugin is utilized during the hot-updater deploy command to upload bundles generated by the Build Plugin. It ensures that the update files are stored in a designated storage solution.

Supported Plugins

  • @hot-updater/supabase: Provides supabaseStorage functionality, leveraging Supabase for storage.
  • @hot-updater/aws: Provides s3Storage functionality, enabling the use of AWS S3 for storage.

Database Plugin

The Database Plugin is responsible for storing the metadata required to check for updates. This plugin is activated during the execution of the hot-updater deploy command.

Supported Plugins

  • @hot-updater/supabase: Provides supabaseDatabase functionality, using Supabase as a database solution.
  • @hot-updater/aws: Provides s3Database functionality, utilizing AWS for database storage.
  • @hot-updater/postgres: Supports PostgreSQL for update metadata storage.

Example Usage

Supabase
Only AWS S3
AWS S3 + Postgres

Here’s an example of how to configure supabaseStorage and supabaseDatabase with environment variables for a seamless storage setup:

import { metro } from "@hot-updater/metro";
import { supabaseStorage, supabaseDatabase } from "@hot-updater/supabase";
import { defineConfig } from "hot-updater";
import "dotenv/config";

export default defineConfig({
  build: metro(),
  storage: supabaseStorage({
    supabaseUrl: process.env.HOT_UPDATER_SUPABASE_URL!,
    supabaseAnonKey: process.env.HOT_UPDATER_SUPABASE_ANON_KEY!,
    bucketName: process.env.HOT_UPDATER_SUPABASE_BUCKET_NAME!,
  }),
  database: supabaseDatabase({
    supabaseUrl: process.env.HOT_UPDATER_SUPABASE_URL!,
    supabaseAnonKey: process.env.HOT_UPDATER_SUPABASE_ANON_KEY!,
  }),
});

In this configuration:

  • supabaseUrl: The base URL of your Supabase project, typically obtained from the Supabase dashboard.
  • supabaseAnonKey: The anonymous API key for accessing Supabase, also available in the dashboard.
  • bucketName: The name of the bucket where update bundles will be stored.

By using environment variables, sensitive information is kept secure and can be easily managed across environments.