Skip to content

Project Management

Manage your SilverOTA projects using the project command group.

Commands

project list

List all projects in your account.

bash
silverbullet-ota project list

Example output:

Projects:
  • MyApp (iOS & Android)
    ID: proj_abc123
    Created: 2024-01-15

  • DemoApp (iOS & Android)
    ID: proj_def456
    Created: 2024-02-20

project init

Initialize SilverOTA in your React Native project with an interactive setup wizard.

bash
silverbullet-ota project init

This is the primary command for setting up OTA updates in a new project.

Project Init Wizard

The project init command guides you through a comprehensive setup process.

Step-by-Step Walkthrough

1. Select Build Plugin

Choose between two build plugins:

Bare (React Native CLI)

✔ Select a build plugin › Bare (React Native CLI)
  • For projects using React Native CLI
  • Installs @silverbullet-ota/bare
  • Supports Hermes and JSC

Expo

✔ Select a build plugin › Expo
  • For Expo-managed workflows
  • Installs @silverbullet-ota/expo
  • Compatible with EAS Build

2. Package Installation

The wizard automatically installs required packages:

Installing packages...
  • @silverbullet-ota/react-native
  • @silverbullet-ota/bare (or @silverbullet-ota/expo)
✓ Packages installed successfully

These packages are added to your package.json:

  • @silverbullet-ota/react-nativedependencies
  • Build plugin → devDependencies

3. Select Organization

Choose which organization this project belongs to:

✔ Select an organization › Personal

If you only have one organization, it's auto-selected.

4. Select or Create Project

Choose an existing project or create a new one:

✔ Select a project
  › Create new project
    MyApp (iOS & Android)
    DemoApp (iOS & Android)

If creating new:

✔ Project name … MyNewApp
✔ Project created successfully

5. API Key Setup

The wizard manages API keys for the production channel:

Scenario A: No production key exists

No production API keys found. Creating one...
✓ API key created successfully

Scenario B: One production key exists

✓ Using existing production API key

Scenario C: Multiple production keys exist

✔ Select an API key
  › pk_prod_abc123... (Created: 2024-01-15)
    pk_prod_def456... (Created: 2024-02-01)

6. Configuration File Creation

An ota.config.ts file is created in your project root:

For 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 }),
});

For 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()
});

TIP

The wizard auto-detects your iOS Info.plist and Android strings.xml paths using glob patterns.

7. Package Scripts Added

Deployment scripts are added to your package.json:

json
{
  "scripts": {
    "silverbullet:deploy:android": "silverbullet-ota deploy --platform android",
    "silverbullet:deploy:ios": "silverbullet-ota deploy --platform ios"
  }
}

Now you can deploy with:

bash
npm run silverbullet:deploy:ios
npm run silverbullet:deploy:android

8. .gitignore Updated

The .silverbullet-ota output directory is added to your .gitignore:

gitignore
# SilverOTA
.silverbullet-ota/

This prevents build artifacts from being committed to your repository.

Configuration Details

Auto-Detection

The wizard automatically detects:

iOS Info.plist files:

  • Searches in ios/ directory
  • Excludes Pods/ and build/ directories
  • Finds all Info.plist files

Android strings.xml files:

  • Searches in android/app/src/main/res/values/
  • Excludes build/ and generated/ directories

Hermes Detection (Bare React Native)

For bare projects, the wizard checks if Hermes is enabled:

javascript
// android/app/build.gradle
enableHermes: true

And configures the build plugin accordingly:

typescript
bare({ enableHermes: true })

After Initialization

Once project init completes, you should:

  1. Configure your React Native app - Add SilverOTA SDK to your app entry point

    tsx
    import { SilverOTA } from '@silverbullet-ota/react-native';
  2. Set your channel - Configure which channel your app uses

    bash
    npx silverbullet-ota channel set production
  3. Rebuild your app - Native code changes require a rebuild

    bash
    npx react-native run-ios
    # or
    npx react-native run-android
  4. Deploy your first update

    bash
    npm run silverbullet:deploy:ios

Re-running Init

If you need to reconfigure your project, you can run project init again. However:

WARNING

Re-running project init will overwrite your ota.config.ts file. If you've made manual changes, back them up first.

Troubleshooting

No Info.plist or strings.xml found

The wizard might not auto-detect files in non-standard locations. You can manually edit ota.config.ts to add the correct paths.

Next Steps