Search…
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.
1
yarn add '@sudoplatform/sudo-password-manager'
2
# or
3
npm install --save '@sudoplatform/sudo-password-manager'
Copied!
In order to instantiate a Password Manager client, make sure you have followed instructions for Getting Started, User SDK, and Sudo SDK (see Prerequisites above).
In addition to the common Users, Sudos, and Entitlements SDKs, the Password Manager SDK depends on the Sudo Secure Vault SDK. You can provide these dependencies when instantiating PasswordManagerClient.
To instantiate a client in your application, add the following:
TypeScript
1
import {
2
PasswordManagerClient,
3
BrowserKeyDerivingKeyStore
4
} from '@sudoplatform/sudo-password-manager'
5
import { DefaultConfigurationManager } from '@sudoplatform/sudo-common'
6
import { DefaultSudoUserClient } from '@sudoplatform/sudo-user'
7
import { DefaultSudoProfilesClient } from '@sudoplatform/sudo-profiles'
8
import { DefaultSudoEntitlementsClient } from '@sudoplatform/sudo-entitlements'
9
import { DefaultSudoSecureVaultClient } from '@sudoplatform/sudo-secure-vault'
10
​
11
const sdkConfigJSON = /* ... refer to Users documentation ... */
12
DefaultConfigurationManager.getInstance().setConfig(sdkConfigJSON)
13
​
14
const secretCodeStore = new BrowserKeyDerivingKeyStore()
15
const userClient = new DefaultSudoUserClient(/* refer to Users documentation */)
16
const profilesClient = new DefaultSudoProfilesClient(/* refer to Sudos documentation */)
17
const entitlementsClient = new DefaultSudoEntitlementsClient(/* refer to Entitlements documentation */)
18
const secureVaultConfig = undefined // undefined to use the config from DefaultConfigurationManager
19
​
20
const client = new PasswordManagerClient(
21
secretCodeStore,
22
userClient,
23
profilesClient,
24
entitlementsClient,
25
secureVaultConfig,
26
{ logBackgroundReconciliationError: console.warn }
27
)
Copied!

Integrate the iOS SDK

Add this line to your Podfile:
1
pod 'SudoPasswordManager'
Copied!
Install pod dependencies by running the following command in your project directory:
1
pod install --repo-update
Copied!
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, and Sudo SDK (see Prerequisites above)
To instantiate a client in your application, add the following:
Swift
1
import SudoEntitlements
2
import SudoPasswordManager
3
import SudoProfiles
4
import SudoUser
5
​
6
let userClient = // ... see "Users" docs
7
let profilesClient = // ... see "Sudos" docs
8
let entitlementsClient = // ... see "Entitlements" docs
9
let passwordManagerClient = try DefaultPasswordManagerClient(userClient: userClient, profilesClient: profilesClient, entitlementsClient: entitlementsClient)
Copied!
You only need one client instance for a given user per device. Instantiating multiple clients with the same configuration and using them at the same time may cause unexpected runtime errors to occur.
See it in action. Be sure to take a look at the open-source iOS sample app on GitHub that our team published as a reference for integrating the Password Manager SDK into your app as quickly and seamlessly as possible.

Integrate the Android SDK

Add this line to the dependencies section of the app module build.gradle and run Gradle sync.
1
dependencies {
2
api 'com.sudoplatform:sudopasswordmanager:1.0.0'
3
}
Copied!
In order to instantiate a Password Manager client, make sure you have followed instructions for Getting Started, User SDK, and Sudo SDK (see Prerequisites above)
To instantiate a client in your application, add the following:
Kotlin
1
val logger = // ... use your implemenation of logger
2
val userClient = // ... see "Users" docs
3
val profilesClient = // ... see "Sudos" docs
4
​
5
val sudoPasswordManager = SudoPasswordManagerClient.builder()
6
.setContext(this)
7
.setSudoUserClient(sudoUserClient)
8
.setSudoProfilesClient(sudoProfilesClient)
9
.setLogger(logger)
10
.build()
Copied!
You only need one client instance for a given user per device. Instantiating multiple clients with the same configuration and using them at the same time may cause unexpected runtime errors to occur.
See it in action. Be sure to take a look at the open source Android sample app on GitHub that our team published as a reference for integrating the Password Manager SDK into your app as quickly and seamlessly as possible.
Last modified 8mo ago