Skip to content

initializeSDK

initializeSDK(): void

Initializes the Authentication SDK using credentials from TransmitSecurity.plist (iOS) or strings.xml (Android).

Example

import TSAuthenticationSDKModule from 'react-native-ts-authentication';

TSAuthenticationSDKModule.initializeSDK();

initialize

initialize(clientId, domain?, baseUrl?): void

Initializes the Authentication SDK with explicit parameters instead of plist/strings.xml configuration.

Parameters

NameTypeDescription
clientIdstringClient ID obtained from the app > client settings in the Admin Portal
domain?string | nullCustom domain, can be null
baseUrl?string | nullBase URL for the API. Defaults to https://api.transmitsecurity.io

Example

import TSAuthenticationSDKModule from 'react-native-ts-authentication';

TSAuthenticationSDKModule.initialize('YOUR_CLIENT_ID');

registerWebAuthn

registerWebAuthn(username, displayName): Promise<{ result: string }>

Registers WebAuthn passkey credentials for a user. The returned result should be sent to your backend to complete the registration process.

Parameters

NameTypeDescription
usernamestringA representation of the user in your system (email, phone, or account ID)
displayNamestringA user-friendly display name for the credential

Returns

Promise<{ result: string }> — Encoded WebAuthn result to send to your backend.

Example

import TSAuthenticationSDKModule from 'react-native-ts-authentication';

const response = await TSAuthenticationSDKModule.registerWebAuthn(username, displayName);
// Send response.result to your backend to complete registration

authenticateWebAuthn

authenticateWebAuthn(username): Promise<{ result: string }>

Authenticates a user using their registered WebAuthn passkey credentials. The returned result should be sent to your backend to complete the authentication process.

Parameters

NameTypeDescription
usernamestringThe username associated with the registered credentials

Returns

Promise<{ result: string }> — Encoded WebAuthn result to send to your backend.

Example

import TSAuthenticationSDKModule from 'react-native-ts-authentication';

const response = await TSAuthenticationSDKModule.authenticateWebAuthn(username);
// Send response.result to your backend to complete authentication

signWebauthnTransaction

signWebauthnTransaction(username): Promise<{ result: string }>

Signs a transaction using WebAuthn credentials for the specified user.

Parameters

NameTypeDescription
usernamestringThe username associated with the registered credentials

Returns

Promise<{ result: string }> — Encoded WebAuthn result to send to your backend.

Example

import TSAuthenticationSDKModule from 'react-native-ts-authentication';

const response = await TSAuthenticationSDKModule.signWebauthnTransaction(username);
// Send response.result to your backend

registerNativeBiometrics

registerNativeBiometrics(username): Promise<{ result: string }>

Registers native biometric credentials (FaceID/TouchID on iOS, fingerprint/face on Android) for a user.

Parameters

NameTypeDescription
usernamestringThe username to associate with the biometric credential

Returns

Promise<{ result: string }> — Result to send to your backend to complete registration.

Example

import TSAuthenticationSDKModule from 'react-native-ts-authentication';

const response = await TSAuthenticationSDKModule.registerNativeBiometrics(username);
// Send response.result to your backend

authenticateNativeBiometrics

authenticateNativeBiometrics(username, challenge): Promise<{ result: string }>

Authenticates a user using registered native biometric credentials.

Parameters

NameTypeDescription
usernamestringThe username associated with the registered biometrics
challengestringA random challenge string for the authentication request

Returns

Promise<{ result: string }> — Result to send to your backend to complete authentication.

Example

import TSAuthenticationSDKModule from 'react-native-ts-authentication';

const { challenge } = await fetch('/api/auth/challenge').then((res) => res.json());
const response = await TSAuthenticationSDKModule.authenticateNativeBiometrics(username, challenge);
// Send `response.result` to your backend

approvalWebAuthn

approvalWebAuthn(username, approvalData, options): Promise<{ result: string }>

Approves a transaction or action using WebAuthn credentials.

Parameters

NameTypeDescription
usernamestringThe username associated with the credentials
approvalData{ [key: string]: string }Key-value object containing approval data
optionsany[]Additional options

Returns

Promise<{ result: string }>

Example

import TSAuthenticationSDKModule from 'react-native-ts-authentication';

const approvalData = { transactionId: '12345', amount: '$100' };
const result = await TSAuthenticationSDKModule.approvalWebAuthn(username, approvalData, []);

approvalWebAuthnWithData

approvalWebAuthnWithData(authenticationData, options): Promise<{ result: string }>

Approves a transaction or action using pre-obtained WebAuthn authentication data, without requiring the username to be passed separately.

Parameters

NameTypeDescription
authenticationDataTSWebAuthnAuthenticationDataPre-obtained WebAuthn authentication data object
optionsany[]Additional options

Returns

Promise<{ result: string }>

Example

import TSAuthenticationSDKModule from 'react-native-ts-authentication';

const authenticationData = {
    webauthnSessionId: 'session-id',
    credentialRequestOptions: { /* ... */ }
};

const result = await TSAuthenticationSDKModule.approvalWebAuthnWithData(authenticationData, []);

approvalNativeBiometrics

approvalNativeBiometrics(username, challenge): Promise<{ result: string }>

Approves a transaction or action using native biometric credentials.

Parameters

NameTypeDescription
usernamestringThe username associated with the credentials
challengestringA random challenge string for the approval request

Returns

Promise<{ result: string }>

Example

import TSAuthenticationSDKModule from 'react-native-ts-authentication';

const result = await TSAuthenticationSDKModule.approvalNativeBiometrics(username, challenge);

registerPinCode

registerPinCode(username, pinCode): Promise<{ contextIdentifier: string }>

Registers a PIN code for a user. After registration, call commitPinRegistration() to finalize.

Parameters

NameTypeDescription
usernamestringThe username to associate with the PIN
pinCodestringThe PIN code to register

Returns

Promise<{ contextIdentifier: string }> — Contains the context identifier needed to commit the registration.

Example

import TSAuthenticationSDKModule from 'react-native-ts-authentication';

const result = await TSAuthenticationSDKModule.registerPinCode(username, pinCode);
await TSAuthenticationSDKModule.commitPinRegistration(result.contextIdentifier);

commitPinRegistration

commitPinRegistration(contextIdentifier): Promise<void>

Commits a PIN code registration initiated by registerPinCode().

Parameters

NameTypeDescription
contextIdentifierstringThe context identifier returned by registerPinCode()

authenticatePinCode

authenticatePinCode(username, pinCode): Promise<{ result: string }>

Authenticates a user using their registered PIN code.

Parameters

NameTypeDescription
usernamestringThe username associated with the PIN
pinCodestringThe PIN code to authenticate with

Returns

Promise<{ result: string }> — Result to send to your backend.

Example

import TSAuthenticationSDKModule from 'react-native-ts-authentication';

const result = await TSAuthenticationSDKModule.authenticatePinCode(username, pinCode);

getDeviceInfo

getDeviceInfo(): Promise<object>

Returns information about the current device.

Returns

Promise<object> — Device information object.

Example

import TSAuthenticationSDKModule from 'react-native-ts-authentication';

const deviceInfo = await TSAuthenticationSDKModule.getDeviceInfo();

isWebAuthnSupported

isWebAuthnSupported(): Promise<boolean>

Checks whether the current device supports WebAuthn passkeys.

Returns

Promise<boolean>true if WebAuthn is supported.

Example

import TSAuthenticationSDKModule from 'react-native-ts-authentication';

const isSupported = await TSAuthenticationSDKModule.isWebAuthnSupported();