Installation
There are three ways to add the Alphyn Flutter 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 vendors the plugin, wires both native layers, and installs the build-registration hooks. Recommended.
- Option 2, from the registry by hand: add the plugin as a hosted
pubdependency; nothing is downloaded. - Option 3, from a downloaded ZIP: extract the plugin next to your app; the native binaries still come from the registry.
On every path the SDK’s native binaries (Alphyn.xcframework for iOS, the com.byterialab:alphyn-sdk AAR for Android) resolve from the Alphyn package registry at build time, 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 integrate --android-api-key <ANDROID_APP_KEY> --ios-api-key <IOS_APP_KEY>It vendors the plugin, wires both native layers, and installs the build-registration hooks. See Getting started for the full flow, then run alphyn-cli doctor.
Option 2: Install from the registry, by hand (no CLI)
Section titled “Option 2: Install from the registry, by hand (no CLI)”The Alphyn Flutter SDK is a federated plugin of four packages (alphyn_sdk, alphyn_sdk_android, alphyn_sdk_ios, alphyn_sdk_platform_interface). It is not on pub.dev, but Byteria publishes it to the Alphyn package registry’s pub server, so you can add it as a hosted dependency with nothing to download.
Before you start: register your Android and iOS apps and generate their API keys (see How to Register Your App).
Step 1. Register the pub token. It reads your app API key from ALPHYN_REGISTRY_KEY at resolve time, so no secret is written to disk:
dart pub token add https://packages.byterialab.com/pub --env-var ALPHYN_REGISTRY_KEYStep 2. Add the hosted dependency to your pubspec.yaml:
dependencies: alphyn_sdk: hosted: https://packages.byterialab.com/pub version: <version>To find the latest <version>, ask the registry GET https://packages.byterialab.com/pub/api/packages/alphyn_sdk and read .latest.version.
Step 3. Resolve it:
flutter pub getExpected result: flutter pub get resolves alphyn_sdk from the registry. If it cannot authenticate, recheck Step 1 and that ALPHYN_REGISTRY_KEY is exported.
Then do the native setup below.
Option 3: Install the plugin from a downloaded ZIP
Section titled “Option 3: Install the plugin from a downloaded ZIP”If you cannot fetch the plugin from the registry, use the ZIP archive instead. Only the Dart plugin comes from the ZIP: its native binaries still resolve from the registry at build time, so you still need ALPHYN_REGISTRY_KEY and the native setup below.
Step 1. Extract the ZIP so the four package folders sit next to your app project:
your_workspace/├── your_app/├── alphyn_sdk/├── alphyn_sdk_android/├── alphyn_sdk_ios/└── alphyn_sdk_platform_interface/Step 2. Add the SDK to your pubspec.yaml as a path dependency pointing at the extracted alphyn_sdk package (adjust the relative path if you extracted it elsewhere), then run flutter pub get:
dependencies: alphyn_sdk: path: ../alphyn_sdkThen do the native setup below.
Native setup (both manual paths)
Section titled “Native setup (both manual paths)”Whichever manual option you used, both native layers still need the wiring the CLI would otherwise do, and the native binaries resolve from the registry. Register the authenticated registry Maven in your Android Gradle repositories, add the required iOS Info.plist keys and the AppDelegate register() hook, and set ALPHYN_REGISTRY_KEY at build time. The exact, copy-pasteable steps for both platforms are in Platform Setup; the iOS framework is fetched from the registry during pod install.