Skip to content
On this page

License

The Binah.ai SDK uses a licensing mechanism to protect against unauthorized usage, and to grant measurement permissions specified in Binah's license agreement.

License Types

Binah offers the license types:

  1. Active Users
  2. Sessions

Using the License Key

A valid license key must be provided in order to initiate a measurement session or activate a user.

Kotlin
try {
    val licenseDetails = LicenseDetails("<ENTER_YOUR_LICENSE_KEY>") 
    val session = FaceSessionBuilder(applicationContext) 
                    .withImageListener(this)
                    .withVitalSignsListener(this)
                    .withSessionInfoListener(this)
                    .build(licenseDetails) 
} catch (e: HealthMonitorException) {
    Log.i("ERROR", "Received Error. Domain: ${e.domain} Code: ${e.errorCode}")
}
Java
try {
    LicenseKey licenseDetails = new LicenseDetails("<ENTER_YOUR_LICENSE_KEY>") 
    Session session = new FaceSessionBuilder(getApplicationContext()) 
                    .withImageListener(this)
                    .withVitalSignsListener(this)
                    .withSessionInfoListener(this)
                    .build(licenseDetails); 
} catch (HealthMonitorException e) {
    Log.i("ERROR", "Received Error. Domain: "+ e.getDomain() +" Code: "+ e.getErrorCode());
}

WARNING

The application must secure the license key and prevent it from being exposed to 3rd parties.

Receiving License Updates

The SDK sends a LicenseInfo object that contains:

The application can receive license-related messages by implementing onLicenseInfo as part of SessionInfoListener:

Kotlin
override fun onSessionStateChange(sessionState: SessionState) {
    // Receive session state updates
}

override fun onWarning(warningData: WarningData) {
    // Receive warnings
}

override fun onError(errorData: ErrorData) {
    // Receive errors
}

override fun onLicenseInfo(licenseInfo: LicenseInfo) { 
    // Receive license info 
}

override fun onEnabledVitalSigns(enabledVitalSigns: SessionEnabledVitalSigns) {
    // Receive the enabled vital signs for the session
}
Java
@Override
public void onSessionStateChange(SessionState sessionState) { 
    // Receive session state updates
}

@Override
public void onWarning(WarningData warningData) {
    // Receive warnings
}

@Override
public void onError(ErrorData errorData) {
    // Receive errors
}

@Override 
public void onLicenseInfo(LicenseInfo licenseInfo) { 
    // Receive license info 
}

@Override
public void onEnabledVitalSigns(SessionEnabledVitalSigns sessionEnabledVitalSigns) {
    // Receive the enabled vital signs for the session
}