Skip to content

Step 3. Install modules

Installing modules means adding the product modules your app uses to the dependencies of your Unity project. The Hive Axyl SDK is structured so that you select and install only the features you need.

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 modules for authentication features

Guest login, username login, logout, and account deletion require the following modules.

  • com.com2usplatform.hiveaxyl.auth: A module required for account creation and login
  • com.com2usplatform.hiveaxyl.storage: A module required for logout and account deletion, which delete saved tokens

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 above to the Unity project in which you registered the Hive Axyl registry in Install the Hive Axyl SDK. Because the Get started guide covers only login, logout, and account deletion, install three modules: 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.

All Hive Axyl packages use the same version. See Version rules.

Method 1: Install modules in the Unity Editor

Find the authentication module and the storage module in the Package Manager list and install them.

  1. In the Unity Editor, open Window > Package Manager.
  2. In the left list, select My Registries > Hive Axyl.
  3. Select com.com2usplatform.hiveaxyl.auth, and then select Install.
  4. Install com.com2usplatform.hiveaxyl.storage in 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.

{
"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"
}
}
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 requires com.com2usplatform.hiveaxyl.core, the SDK common module, as a dependency, but the feature module that the Add-on extends is not included in its dependencies. Therefore, if you install only an Add-on, the installation finishes without the feature module, and compilation and builds also finish without errors. You find out that the module is missing only when you run the app and the feature does not work. When you use an Add-on, also install the feature module that the Add-on extends.

{
"dependencies": {
    "com.com2usplatform.hiveaxyl.auth": "1.0.0",
    "com.com2usplatform.hiveaxyl.auth.addon.apple": "1.0.0"
}
}

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.

using Hive.Axyl.Core;
using Hive.Axyl.Auth;
using Hive.Axyl.Storage;

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 source of the installed modules is shown as registry in Packages/packages-lock.json
  • No compilation errors occur in the using statements above
  • You are ready to add the initialization code (HiveBootstrap.Initialize) in the next step
Note

To use multiple features other than authentication, such as payment and push, in the production environment, verify the installation after you install all the modules you plan to use.

Next steps

To initialize the SDK, follow Initialize the Hive Axyl SDK.