▸ initializeSDK(): void
Initializes the Authentication SDK using credentials from TransmitSecurity.plist (iOS) or strings.xml (Android).
import TSAuthenticationSDKModule from 'react-native-ts-authentication';
TSAuthenticationSDKModule.initializeSDK();▸ initialize(clientId, domain?, baseUrl?): void
Initializes the Authentication SDK with explicit parameters instead of plist/strings.xml configuration.
| Name | Type | Description |
|---|---|---|
clientId | string | Client ID obtained from the app > client settings in the Admin Portal |
domain? | string | null | Custom domain, can be null |
baseUrl? | string | null | Base URL for the API. Defaults to https://api.transmitsecurity.io |
import TSAuthenticationSDKModule from 'react-native-ts-authentication';
TSAuthenticationSDKModule.initialize('YOUR_CLIENT_ID');▸ 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.
| Name | Type | Description |
|---|---|---|
username | string | A representation of the user in your system (email, phone, or account ID) |
displayName | string | A user-friendly display name for the credential |
Promise<{ result: string }> — Encoded WebAuthn result to send to your backend.
import TSAuthenticationSDKModule from 'react-native-ts-authentication';
const response = await TSAuthenticationSDKModule.registerWebAuthn(username, displayName);
// Send response.result to your backend to complete registration▸ 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.
| Name | Type | Description |
|---|---|---|
username | string | The username associated with the registered credentials |
Promise<{ result: string }> — Encoded WebAuthn result to send to your backend.
import TSAuthenticationSDKModule from 'react-native-ts-authentication';
const response = await TSAuthenticationSDKModule.authenticateWebAuthn(username);
// Send response.result to your backend to complete authentication▸ signWebauthnTransaction(username): Promise<{ result: string }>
Signs a transaction using WebAuthn credentials for the specified user.
| Name | Type | Description |
|---|---|---|
username | string | The username associated with the registered credentials |
Promise<{ result: string }> — Encoded WebAuthn result to send to your backend.
import TSAuthenticationSDKModule from 'react-native-ts-authentication';
const response = await TSAuthenticationSDKModule.signWebauthnTransaction(username);
// Send response.result to your backend▸ registerNativeBiometrics(username): Promise<{ result: string }>
Registers native biometric credentials (FaceID/TouchID on iOS, fingerprint/face on Android) for a user.
| Name | Type | Description |
|---|---|---|
username | string | The username to associate with the biometric credential |
Promise<{ result: string }> — Result to send to your backend to complete registration.
import TSAuthenticationSDKModule from 'react-native-ts-authentication';
const response = await TSAuthenticationSDKModule.registerNativeBiometrics(username);
// Send response.result to your backend▸ authenticateNativeBiometrics(username, challenge): Promise<{ result: string }>
Authenticates a user using registered native biometric credentials.
| Name | Type | Description |
|---|---|---|
username | string | The username associated with the registered biometrics |
challenge | string | A random challenge string for the authentication request |
Promise<{ result: string }> — Result to send to your backend to complete authentication.
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(username, approvalData, options): Promise<{ result: string }>
Approves a transaction or action using WebAuthn credentials.
| Name | Type | Description |
|---|---|---|
username | string | The username associated with the credentials |
approvalData | { [key: string]: string } | Key-value object containing approval data |
options | any[] | Additional options |
Promise<{ result: string }>
import TSAuthenticationSDKModule from 'react-native-ts-authentication';
const approvalData = { transactionId: '12345', amount: '$100' };
const result = await TSAuthenticationSDKModule.approvalWebAuthn(username, approvalData, []);▸ 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.
| Name | Type | Description |
|---|---|---|
authenticationData | TSWebAuthnAuthenticationData | Pre-obtained WebAuthn authentication data object |
options | any[] | Additional options |
Promise<{ result: string }>
import TSAuthenticationSDKModule from 'react-native-ts-authentication';
const authenticationData = {
webauthnSessionId: 'session-id',
credentialRequestOptions: { /* ... */ }
};
const result = await TSAuthenticationSDKModule.approvalWebAuthnWithData(authenticationData, []);▸ approvalNativeBiometrics(username, challenge): Promise<{ result: string }>
Approves a transaction or action using native biometric credentials.
| Name | Type | Description |
|---|---|---|
username | string | The username associated with the credentials |
challenge | string | A random challenge string for the approval request |
Promise<{ result: string }>
import TSAuthenticationSDKModule from 'react-native-ts-authentication';
const result = await TSAuthenticationSDKModule.approvalNativeBiometrics(username, challenge);▸ registerPinCode(username, pinCode): Promise<{ contextIdentifier: string }>
Registers a PIN code for a user. After registration, call commitPinRegistration() to finalize.
| Name | Type | Description |
|---|---|---|
username | string | The username to associate with the PIN |
pinCode | string | The PIN code to register |
Promise<{ contextIdentifier: string }> — Contains the context identifier needed to commit the registration.
import TSAuthenticationSDKModule from 'react-native-ts-authentication';
const result = await TSAuthenticationSDKModule.registerPinCode(username, pinCode);
await TSAuthenticationSDKModule.commitPinRegistration(result.contextIdentifier);▸ commitPinRegistration(contextIdentifier): Promise<void>
Commits a PIN code registration initiated by registerPinCode().
| Name | Type | Description |
|---|---|---|
contextIdentifier | string | The context identifier returned by registerPinCode() |
▸ authenticatePinCode(username, pinCode): Promise<{ result: string }>
Authenticates a user using their registered PIN code.
| Name | Type | Description |
|---|---|---|
username | string | The username associated with the PIN |
pinCode | string | The PIN code to authenticate with |
Promise<{ result: string }> — Result to send to your backend.
import TSAuthenticationSDKModule from 'react-native-ts-authentication';
const result = await TSAuthenticationSDKModule.authenticatePinCode(username, pinCode);▸ getDeviceInfo(): Promise<object>
Returns information about the current device.
Promise<object> — Device information object.
import TSAuthenticationSDKModule from 'react-native-ts-authentication';
const deviceInfo = await TSAuthenticationSDKModule.getDeviceInfo();▸ isWebAuthnSupported(): Promise<boolean>
Checks whether the current device supports WebAuthn passkeys.
Promise<boolean> — true if WebAuthn is supported.
import TSAuthenticationSDKModule from 'react-native-ts-authentication';
const isSupported = await TSAuthenticationSDKModule.isWebAuthnSupported();