Parakey SDK for Android

The Parakey SDK allows your users to access features of the Parakey ecosystem within your application.

You need to be invited in order to access the SDK. Contact Parakey to request access.

Installation

The SDK is hosted in a private Github repository.

  1. Create a Personal Github access token (classic) at Github>User>Settings>Developer settings> Personal access tokens. The token needs package read access only.

  2. Export the token along with your username in your shell configuration file (e.g. .zshrc)

    export GITHUB_USER=<your username>
    export GITHUB_TOKEN=<your personal access token>
  3. Add the Github as a maven repository in the root level build.gradle

    allprojects {
    repositories {
    google()
    mavenCentral()
    maven {
    url = uri("https://maven.pkg.github.com/parakey-ab/parakey-sdk-android")
    credentials {
    username = System.getenv("GITHUB_USER")
    password = System.getenv("GITHUB_TOKEN")
    }
    }
    }
    }
  4. Add a dependency on the SDK in your module level build.gradle

    dependencies {
    implementation 'co.parakey:sdk:<latest version>'
    }

    The latest version can be found under Packages in the Github repo. Beta versions are not recommended for production use.

Example usage

class App : Application() {
override fun onCreate() {
super.onCreate()

Parakey.initialize(this)
MainScope().launch {
val tokenBundle = findTokenBundle()
var error = Parakey.configure(tokenBundle)
if (error == null) {
error = Parakey.showScan()
}
if (error != null) {
// handle ParakeyError
}
}
}

private suspend fun findTokenBundle(): String {
// fetch token bundle from Parakey API or from local storage
}
}

Packages

Link copied to clipboard