Installation
There are three ways to add the Alphyn React Native SDK. Pick one, then do the native setup and initialization: those are the same whichever install method you choose.
- Option 1, the Alphyn CLI: one command declares the SDK dependency from the registry, adds the JS initialization, and wires both native layers. Recommended.
- Option 2, from the registry by hand: install the npm package from the registry; nothing is downloaded.
- Option 3, from a downloaded tarball: install the JS package from a
.tgz; the native binaries still come from the registry.
A React Native project registers as two apps on the portal, one per platform, each with its own API key (see How to Register Your App). On every path the SDK resolves its native binaries from the registry during pod install (iOS) and the Android Gradle build, so set your app API key in the build environment; see SDK Registry Access:
export ALPHYN_REGISTRY_KEY=<YOUR_APP_API_KEY>Install the SDK
Section titled “Install the SDK”Option 1: Install with the Alphyn CLI (recommended)
Section titled “Option 1: Install with the Alphyn CLI (recommended)”alphyn-cli declares the @alphyn/react-native-sdk dependency from the registry, writes the authenticated .npmrc that resolves it, adds the JavaScript initialization, and wires both native layers (the Android layer in particular cannot be wired from a package manager alone):
alphyn-cli integrate \ --android-api-key <ANDROID_APP_KEY> \ --ios-api-key <IOS_APP_KEY>Then install and link the native modules:
npm install # or: yarn / pnpm, your project's package managercd ios && pod installFor the development loop, pin your iOS debug hash as well. An iOS app’s hash changes on every build and only archives register, so debug and simulator builds cannot initialize the SDK without it:
alphyn-cli integrate \ --android-api-key <ANDROID_APP_KEY> \ --ios-api-key <IOS_APP_KEY> \ --ios-debug-hash <64-HEX>The hash comes from the dashboard, under App Details; integrate renders it into a __DEV__-guarded branch, so a release bundle never carries it. Android needs no debug hash: the Gradle hook integrate installs registers every Android build automatically.
Run alphyn-cli doctor afterward. It reports every piece of the integration and names anything missing. For exactly what integrate writes into your project, see CLI: React Native. For a managed Expo project, see Expo.
Option 2: Install from the registry, by hand (no CLI)
Section titled “Option 2: Install from the registry, by hand (no CLI)”Install the npm package straight from the Alphyn package registry, nothing to download. The JavaScript package carries only the JS and the native bridge; the native binaries resolve from the registry at build time.
Before you start: register your Android and iOS apps and generate their API keys (see How to Register Your App).
Step 1. Point the @alphyn scope at the registry in your project’s .npmrc (the token reads your key from the environment, so no secret is committed):
@alphyn:registry=https://packages.byterialab.com/npm///packages.byterialab.com/npm/:_authToken=${ALPHYN_REGISTRY_KEY}Step 2. Install the package:
export ALPHYN_REGISTRY_KEY=<YOUR_APP_API_KEY>npm install @alphyn/react-native-sdk@<version>cd ios && pod installTo find the latest <version>, ask the registry GET https://packages.byterialab.com/npm/@alphyn%2Freact-native-sdk and read dist-tags.latest.
Expected result: npm install fetches @alphyn/react-native-sdk from the registry and pod install links the iOS pod. If either fails to authenticate, recheck ALPHYN_REGISTRY_KEY and the .npmrc lines.
Then do the native setup below.
Option 3: Install the JS package from a downloaded tarball
Section titled “Option 3: Install the JS package from a downloaded tarball”If you cannot fetch the package from the registry, install the .tgz from the SDK Downloads page instead. Only the JS package comes from the tarball: its native binaries still resolve from the registry at build time, so you still need ALPHYN_REGISTRY_KEY and the native setup.
export ALPHYN_REGISTRY_KEY=<YOUR_APP_API_KEY>npm install ./alphyn-react-native-sdk-<version>.tgzcd ios && pod installThen do the native setup below.
Native setup (both manual paths)
Section titled “Native setup (both manual paths)”Both manual paths leave you to wire what the CLI would otherwise do: the Android registry Maven repository, the iOS Info.plist keys and the AppDelegate hook, and the per-build registration. The exact, copy-pasteable steps for both platforms are in Platform Setup. Every build must still be registered, or it fails attestation at runtime with no build-time error.