Integrate the Password Manager SDK

Integrate the Password Manager SDK into your application

Prerequisites

Get Started

Integrate the JS SDK

To use the Password Manager SDK in a Web or Node.js project, you must add @sudoplatform/sudo-password-manager as a dependency to your project.

yarn add '@sudoplatform/sudo-password-manager'
# or
npm install --save '@sudoplatform/sudo-password-manager'

In order to instantiate a Password Manager client, make sure you have followed instructions for Getting Started, User SDK, Sudo Profiles SDK and Entitlements SDK (see Prerequisites above).

In addition, the Password Manager SDK depends on the Sudo Secure Vault SDK. You can provide these dependencies when instantiating the PasswordManagerClient.

To instantiate and initialize a client in your application, add the following:

import {
    PasswordManagerClient,
    BrowserKeyDerivingKeyStore
} from '@sudoplatform/sudo-password-manager'
import { DefaultConfigurationManager } from '@sudoplatform/sudo-common'
import { DefaultSudoUserClient } from '@sudoplatform/sudo-user'
import { DefaultSudoProfilesClient } from '@sudoplatform/sudo-profiles'
import { DefaultSudoEntitlementsClient } from '@sudoplatform/sudo-entitlements'
import { DefaultSudoSecureVaultClient } from '@sudoplatform/sudo-secure-vault'

const sdkConfigJSON = /* ... refer to Users documentation ... */
DefaultConfigurationManager.getInstance().setConfig(sdkConfigJSON)

const secretCodeStore = new BrowserKeyDerivingKeyStore()
const userClient = new DefaultSudoUserClient(/* refer to Users documentation */)
const profilesClient = new DefaultSudoProfilesClient(/* refer to Sudos documentation */)
const entitlementsClient = new DefaultSudoEntitlementsClient(/* refer to Entitlements documentation */)
const secureVaultConfig = undefined // undefined to use the config from DefaultConfigurationManager

const client = new PasswordManagerClient(
    secretCodeStore,
    userClient,
    profilesClient,
    entitlementsClient,
    secureVaultConfig,
    { logBackgroundReconciliationError: console.warn }
)

Integrate the iOS SDK

Add this line to your Podfile:

pod 'SudoPasswordManager'

Install pod dependencies by running the following command in your project directory:

pod install --repo-update

This will update the local CocoaPods repository and install the latest version of the Password Manager SDK.

In order to instantiate a Password Manager client, make sure you have followed instructions for Getting Started, User SDK, Sudo Profiles SDK and Entitlements SDK (see Prerequisites above).

To instantiate a client in your application, add the following:

import SudoEntitlements
import SudoPasswordManager
import SudoProfiles
import SudoUser

let userClient = // ... see "Users" docs
let profilesClient = // ... see "Sudos" docs
let entitlementsClient = // ... see "Entitlements" docs

let passwordManagerClient = try DefaultPasswordManagerClient(
    userClient: userClient, 
    profilesClient: profilesClient, 
    entitlementsClient: entitlementsClient
)

Integrate the Android SDK

The Android SDK is open source and compatible with Android 6 (API level 23) and above.

Add this line to the dependencies section of the app module build.gradle and synchronize your project with Android Studio.

dependencies {
    implementation 'com.sudoplatform:sudopasswordmanager:$latest_version'
}

The latest version of the SDK can be found at SDK Releases.

In order to instantiate a Password Manager client, make sure you have followed instructions for Getting Started, User SDK, Sudo Profiles SDK and Entitlements SDK (see Prerequisites above).

To instantiate a client in your application, add the following:

val logger = // ... use your implemenation of logger
val userClient = // ... see "Users" docs
val profilesClient = // ... see "Sudos" docs

val sudoPasswordManager = SudoPasswordManagerClient.builder()
            .setContext(appContext)
            .setSudoUserClient(userClient)
            .setSudoProfilesClient(profilesClient)
            .setLogger(logger)
            .build()

Last updated