Skip to content

Configuration

Learn how to configure SilverOTA using the ota.config.ts file.

Overview

The ota.config.ts file is created automatically when you run project init. It contains all the configuration needed for building and deploying OTA updates.

File Location

The configuration file must be in your project root:

my-app/
├── ota.config.ts          ← Configuration file
├── package.json
├── ios/
├── android/
└── src/

Basic Configuration

Bare React Native

typescript
import { configureOTA } from 'silverbullet-ota';
import { bare } from '@silverbullet-ota/bare';

export default configureOTA({
  projectId: 'proj_abc123',
  apiKey: 'pk_prod_xyz789',
  build: bare({ enableHermes: true })
});

Expo

typescript
import { configureOTA } from 'silverbullet-ota';
import { expo } from '@silverbullet-ota/expo';

export default configureOTA({
  projectId: 'proj_abc123',
  apiKey: 'pk_prod_xyz789',
  build: expo()
});

Configuration Options

projectId (required)

The unique identifier for your SilverOTA project.

  • Type: string
  • Format: proj_*
  • Example: 'proj_abc123'

You can find your project ID in the dashboard or by running silverbullet-ota project list.

apiKey (required)

The API key for authenticating deployments to a specific channel.

  • Type: string
  • Format: pk_*
  • Example: 'pk_prod_xyz789'

build (required)

The build plugin configuration for bundling your app.

  • Type: bare(options) or expo(options)

platform (optional)

Platform-specific configuration paths.

  • Type: object
  • Auto-detected: During project init
typescript
platform: {
  ios: {
    infoPlistPaths: ['ios/MyApp/Info.plist']
  },
  android: {
    stringResourcePaths: ['android/app/src/main/res/values/strings.xml']
  }
}

Build Plugins

Bare React Native

The bare plugin builds bundles for React Native CLI projects.

typescript
import { bare } from '@silverbullet-ota/bare';

build: bare({
  enableHermes: true,
  entryFile: 'index.js'
})

Options:

  • enableHermes (optional): Enable Hermes engine

    • Type: boolean
    • Default: Auto-detected from android/app/build.gradle
    • Example: true
  • entryFile (optional): Entry point for your app

    • Type: string
    • Default: 'index.js'
    • Example: 'index.js'

Options:

  • entryPoint (optional): Entry point for Expo apps
    • Type: string
    • Default: 'node_modules/expo/AppEntry.js'
    • Example: 'App.js'

Platform Paths

iOS Info.plist Paths

Specify where your iOS Info.plist files are located:

typescript
platform: {
  ios: {
    infoPlistPaths: [
      'ios/MyApp/Info.plist',
      'ios/MyAppExtension/Info.plist'  // For app extensions
    ]
  }
}

The CLI uses these paths to:

  • Read the app version (CFBundleShortVersionString)
  • Update the channel configuration (SILVERBULLET_OTA_CHANNEL)

Android strings.xml Paths

Specify where your Android strings.xml files are located:

typescript
platform: {
  android: {
    stringResourcePaths: [
      'android/app/src/main/res/values/strings.xml'
    ]
  }
}

The CLI uses these paths to:

  • Read the app version (from build.gradle in the same directory)
  • Update the channel configuration (silverbullet_ota_channel)

Config File Discovery

The CLI searches for configuration files in this order:

  1. ota.config.ts
  2. ota.config.js
  3. ota.config.cjs
  4. ota.config.mts
  5. ota.config.cts

The first file found is used.

TypeScript Support

The configuration file has full TypeScript support:

typescript
import { configureOTA, type OTAConfig } from 'silverbullet-ota';
import { bare } from '@silverbullet-ota/bare';

const config: OTAConfig = {
  projectId: 'proj_abc123',
  apiKey: 'pk_prod_xyz789',
  build: bare({ enableHermes: true })
};

export default configureOTA(config);

Next Steps