Step 3. Install modules
Choose the Hive Axyl feature modules your app needs and add them as dependencies in your Unity project.
1. Select common modules
Select the minimum common modules required to use Hive Axyl.
com.com2usplatform.hiveaxyl.core: A module that provides the initialization you call when you start the SDK and the basic features that other modules share
2. Select authentication modules
Guest login, username login, logout, and account deletion require the following modules.
com.com2usplatform.hiveaxyl.auth: Authentication module for creating accounts, signing in, and issuing tokenscom.com2usplatform.hiveaxyl.storage: Secure storage module for deleting tokens stored on the device after logout or account deletion
com.com2usplatform.hiveaxyl.storage provides features that save values specified by the app on the user's device and load them again when needed. You use it to keep login session information on the device, as in Automatic login, and it is also required to delete saved tokens during logout and account deletion.
Note
com.com2usplatform.hiveaxyl.storage works in Android, iOS, macOS, and Windows player builds. A player build is the actual app that you build and run, not the Unity Editor. Because the Unity Editor has no device secure storage, the storage feature is not registered there. For details, see Register the secure storage module.
3. Install modules
Add the modules you selected to the Unity project where you registered the Hive Axyl registry in Install the Hive Axyl SDK. This guide covers login, logout, and account deletion, so install com.com2usplatform.hiveaxyl.core, com.com2usplatform.hiveaxyl.auth, and com.com2usplatform.hiveaxyl.storage.
There are two ways to add modules. Use only one of them.
- Method 1: Install modules in the Unity Editor: Work in Package Manager in the Unity Editor
- Method 2: Add modules to Packages/manifest.json: Work in Packages/manifest.json, which you open in a text editor
All Hive Axyl packages use the same version. See Version rules.
Method 1: Install modules in the Unity Editor
Find and install the authentication and secure storage modules in the Package Manager list.
- In the Unity Editor, open Window > Package Manager.
- In the left list, select My Registries > Hive Axyl.
- Select
com.com2usplatform.hiveaxyl.auth, and then select Install. - Install
com.com2usplatform.hiveaxyl.storagein the same way.
Because both modules require com.com2usplatform.hiveaxyl.core as a dependency, it is installed together even if you do not select it separately in the list.
Method 2: Add modules to Packages/manifest.json
Open Packages/manifest.json of your Unity project in a text editor, and add com.com2usplatform.hiveaxyl.core, com.com2usplatform.hiveaxyl.auth, and com.com2usplatform.hiveaxyl.storage to dependencies.
Note
Because com.com2usplatform.hiveaxyl.auth and com.com2usplatform.hiveaxyl.storage require com.com2usplatform.hiveaxyl.core as a dependency, UPM downloads it from the registry together even if you do not list com.com2usplatform.hiveaxyl.core in dependencies. The example above also lists com.com2usplatform.hiveaxyl.core to make clear which packages are installed.
Modules to install in production
In production, you must install all the feature modules your app uses. An app that uses the authentication, payment, mailbox, service access control, and Analytics features together adds the following dependencies to Packages/manifest.json.
{
"scopedRegistries": [
{
"name": "Hive Axyl",
"url": "https://package.openupm.com",
"scopes": [
"com.com2usplatform.hiveaxyl"
]
}
],
"dependencies": {
"com.com2usplatform.hiveaxyl.core": "1.0.0",
"com.com2usplatform.hiveaxyl.auth": "1.0.0",
"com.com2usplatform.hiveaxyl.storage": "1.0.0",
"com.com2usplatform.hiveaxyl.payments": "1.0.0",
"com.com2usplatform.hiveaxyl.mailbox": "1.0.0",
"com.com2usplatform.hiveaxyl.serviceaccess": "1.0.0",
"com.com2usplatform.hiveaxyl.analytics": "1.0.0"
}
}
Modules to install together when you use Add-ons
Hive Axyl packages are divided into feature modules and Add-ons. If you install only an Add-on, the installation finishes without errors, but the feature does not work.
| Package type | Role | Example |
|---|---|---|
| Feature module | Handles an entire feature, such as authentication or payment. | Authentication module com.com2usplatform.hiveaxyl.auth |
| Add-on | Connects the features that a feature module provides to a specific platform or external service. | Apple login Add-on com.com2usplatform.hiveaxyl.auth.addon.apple |
For example, the Apple login Add-on com.com2usplatform.hiveaxyl.auth.addon.apple connects Apple accounts to the login that the authentication module com.com2usplatform.hiveaxyl.auth provides. As in this example, the name of an Add-on starts with the name of the feature module that the Add-on extends.
An Add-on depends on com.com2usplatform.hiveaxyl.core, the SDK core module. The Add-on does not list the feature module it extends as a dependency. With just the Add-on installed, the app compiles and builds successfully, but the feature does not work. Install the feature module with its Add-on.
Apart from Add-ons, you only need to install the packages your app uses directly. The rest are installed together as dependencies.
The guest login and username login covered in the Get started guide do not require Add-ons. Check below which Add-ons each feature requires.
- Login: Required for each login method. For the Add-on for each login method, see Install and initialize the module.
- Payment: Required for each store. For the Add-on for each store, see Payment.
- Push notifications: Required for each way of receiving notifications. For the Add-on for each way, see Push notifications.
- Storage, mailbox, service access control, and Analytics: Install only the feature module, without Add-ons
4. Verify the installation
Check that the namespaces of the installed SDK and authentication module are recognized correctly in using statements.
To check without opening the Unity Editor, open Packages/packages-lock.json. Check that the version of every installed Hive Axyl package has the same value and that source is registry. If source is not registry, the package was fetched from outside the registry, such as from a Git URL or a local path.
The installation step is complete when all of the following are met.
- The installed modules are shown as Installed in Unity Package Manager
- The
sourceof the installed modules is shown asregistryin Packages/packages-lock.json - No compilation errors occur in the
usingstatements above - You are ready to add the initialization code (
HiveBootstrap.Initialize) in the next step
Note
If your app uses additional features such as payment or push notifications, install all required modules before verifying the installation.
Next steps
After installing the modules, see Initialize the Hive Axyl SDK.