SDK Installation
Install via npm
npm install @norrix/client-sdkPlatform Support
| Platform | Minimum NativeScript Version |
|---|---|
| iOS | 8.0.0 |
| Android | 8.0.0 |
Applying an update in the current process (a soft reboot, instead of waiting for the next cold launch) needs a runtime that exposes NativeScriptRuntime.reloadApplication. The @nativescript/ios 9.1.0 release does not (a 9.1.x patch adds it), so on it and on older runtimes the SDK falls back to a process restart with the same result.
What’s Included
The SDK package includes:
TypeScript SDK
The main SDK code for checking and applying OTA updates.
Native Modules
Pre-built native libraries for OTA loading:
- iOS:
NorrixOTA.xcframework - Android:
NorrixAndroidOTA.aar
These pick the bundle to boot before the JavaScript runtime starts, and record a launch that never reached it.
NativeScript Hooks
Automatically configured hooks that run during ns prepare:
| Hook | Type | Description |
|---|---|---|
norrix-ota-ios | after-prepare | Configures iOS OTA loading |
norrix-ota-android | after-prepare | Configures Android OTA loading |
The hooks are defined in the package.json and executed automatically.
On iOS the hook patches the boot file (main.m, or NativeScriptStart.m on visionOS) to route the base directory through [NorrixOTA applicationPathWithDefault:baseDir], and to call [NorrixOTA runMainApplicationDidReturn] after runMainApplication. That call only ever runs when the JavaScript bootstrap failed before reaching UIApplicationMain, which is how a bundle that cannot start is detected.
Upgrading to
@norrix/client-sdk3.x changes the native loader, so publish a new store build before publishing OTA updates for it. Devices still on an older binary keep the loader they shipped with.
On-device Layout
The SDK owns one directory, shared with the native loader:
| Path | Contents |
|---|---|
norrix_ota/state.json | Installed updates, launch outcomes, quarantined ids |
norrix_ota/<updateId>-<platform>/ | An installed update, with its norrix-install.json marker |
norrix_ota/.tmp-<updateId>-<platform>/ | An install in progress; ignored by the loader |
The root is <Documents>/norrix_ota on iOS and <filesDir>/norrix_ota on Android.
Dependencies
The SDK installs these dependencies:
| Package | Purpose |
|---|---|
@nativescript/zip | Extracting OTA update bundles |
Peer Dependencies
The SDK expects these to be in your project:
| Package | Version |
|---|---|
@nativescript/core | ^8.0.0 or ^9.0.0 |
Verification
After installation, verify the SDK is available:
import { initNorrix } from '@norrix/client-sdk';
// If this compiles, the SDK is installed correctlyProject Structure
After installation, your project should include:
node_modules/
@norrix/
client-sdk/
dist/ # Compiled SDK code
platforms/
ios/ # iOS native module
android/ # Android native module
scripts/ # NativeScript hooksNext Steps
- Configuration: Configure the SDK
- Usage Guide: Implement OTA updates