# Functions

## initializeSDK

▸ **initializeSDK**(): `void`

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

### Example

```javascript
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

| 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` |


### Example

```javascript
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

| 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 |


### Returns

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

### Example

```javascript
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

| Name | Type | Description |
|  --- | --- | --- |
| `username` | `string` | The username associated with the registered credentials |


### Returns

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

### Example

```javascript
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

| Name | Type | Description |
|  --- | --- | --- |
| `username` | `string` | The username associated with the registered credentials |


### Returns

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

### Example

```javascript
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

| Name | Type | Description |
|  --- | --- | --- |
| `username` | `string` | The username to associate with the biometric credential |


### Returns

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

### Example

```javascript
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

| Name | Type | Description |
|  --- | --- | --- |
| `username` | `string` | The username associated with the registered biometrics |
| `challenge` | `string` | A random challenge string for the authentication request |


### Returns

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

### Example

```javascript
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

| 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 |


### Returns

`Promise<{ result: string }>`

### Example

```javascript
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

| Name | Type | Description |
|  --- | --- | --- |
| `authenticationData` | `TSWebAuthnAuthenticationData` | Pre-obtained WebAuthn authentication data object |
| `options` | `any[]` | Additional options |


### Returns

`Promise<{ result: string }>`

### Example

```javascript
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

| Name | Type | Description |
|  --- | --- | --- |
| `username` | `string` | The username associated with the credentials |
| `challenge` | `string` | A random challenge string for the approval request |


### Returns

`Promise<{ result: string }>`

### Example

```javascript
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

| Name | Type | Description |
|  --- | --- | --- |
| `username` | `string` | The username to associate with the PIN |
| `pinCode` | `string` | The PIN code to register |


### Returns

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

### Example

```javascript
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

| Name | Type | Description |
|  --- | --- | --- |
| `contextIdentifier` | `string` | The context identifier returned by `registerPinCode()` |


## authenticatePinCode

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

Authenticates a user using their registered PIN code.

### Parameters

| Name | Type | Description |
|  --- | --- | --- |
| `username` | `string` | The username associated with the PIN |
| `pinCode` | `string` | The PIN code to authenticate with |


### Returns

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

### Example

```javascript
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

```javascript
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

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

const isSupported = await TSAuthenticationSDKModule.isWebAuthnSupported();
```

style
table th:first-of-type {
    width: 20%;
}
table th:nth-of-type(2) {
    width: 20%;
}
table th:nth-of-type(3) {
    width: 60%;
}