@loginid/wallet-sdk
v0.45.41-beta
Published
loginid wallet sdk
Downloads
10
Keywords
Readme
LoginID Wallet SDK
LoginID Wallet SDK is a javascript library to securely connect to LoginID Wallet to manage passwordless account with Passkeys and ID Passes.
Add SDK to Application
Install using npm:
npm install @loginid/wallet-sdk
Create SDK Instance
import {WalletSDK} from "@loginid/wallet-sdk";
// initialize wallet instance
const wallet = new WalletSDK(process.env.VAULT_URL || "https://vault.testnet.loginid.io");
LoginID Wallet signup
An api for sign in / sign up new LoginID Wallet account.
Function:
async signup(): Promise<SignupResult>
Interfaces:
export interface SignupResult {
token: string;
claims: IDToken;
}
export interface IDToken {
sub: string;
client: string;
nonce?: string;
iat: number;
}
Example:
try {
const result = await wallet.signup();
console.log(result.claims.sub)
} catch (error) {
console.log(error);
}