CapsuleMobile Class

The CapsuleMobile class represents a mobile implementation of the Capsule SDK, extending the CoreCapsule class.

Methods

constructor()
Function

Creates an instance of CapsuleMobile.

env
Environment

The environment to use (DEV, SANDBOX, BETA, or PROD).

apiKey
string

The API key for authentication.

relyingPartyId
string

The relying party ID for WebAuthn.

opts
ConstructorOpts

Additional constructor options.

verifyEmailBiometricsId()
Function

Verifies an email and returns the biometrics ID.

verificationCode
string

The verification code sent to the email.

biometricsId
Promise<string>

The biometrics ID.

verifyPhoneBiometricsId()
Function

Verifies a phone number and returns the biometrics ID.

verificationCode
string

The verification code sent to the phone.

biometricsId
Promise<string>

The biometrics ID.

registerPasskey()
Function

Registers a passkey for the user.

identifier
string

The user’s email or phone number.

biometricsId
string

The biometrics ID obtained from verification.

crypto
webcrypto.Crypto

The Web Crypto API instance.

identifierType
'email' | 'phone'
default: "'email'"

The type of identifier used.

countryCode
CountryCallingCode

The country calling code for phone numbers.

result
Promise<void>

A promise that resolves when the passkey is registered.

login()
Function

Logs in the user using either email or phone number.

email
string

The user’s email address.

phone
string

The user’s phone number.

countryCode
CountryCallingCode

The country calling code for phone numbers.

wallets
Promise<Wallet[]>

An array of user wallets.

error
Error

If neither email nor both phone and countryCode are provided.