# Overview

The `react-native-ts-authentication` is a React Native module for Mosaic Authentication. It provides secure biometric authentication capabilities for your mobile application. It wraps both Apple's public-private key authentication for passkeys on iOS and Google's Credential Manager API for passkeys on Android, delivering a unified native experience for FIDO2-based authentication.

## Capabilities

- WebAuthn passkey registration and authentication
- Native biometric authentication (FaceID/TouchID on iOS, fingerprint/face on Android)
- Transaction signing with WebAuthn and native biometrics
- PIN code registration and authentication
- Device info and WebAuthn support detection


## Requirements

- iOS 15.0+
- Android 5+ (API level 21+)
- Device with registered biometrics (FaceID/TouchID on iOS, fingerprint/face on Android)
- iCloud Keychain enabled (iOS) or Google Play Services (Android)


## Installation

npm
```shell
npm install react-native-ts-authentication
```

yarn
```shell
yarn add react-native-ts-authentication
```

For iOS, install native dependencies and set your minimum target:

```shell
cd YOUR_PROJECT_PATH/ios
pod install
```

Set `platform :ios, '15.0'` in your `Podfile`.

For Android, add the Mosaic Maven repository to your `app/build.gradle`:

```groovy
repositories {
    google()
    maven {
        url('https://transmit.jfrog.io/artifactory/transmit-security-gradle-release-local/')
    }
}
```

## Initialization

iOS
Create a `TransmitSecurity.plist` file in your Xcode project:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>credentials</key>
    <dict>
        <key>baseUrl</key>
        <string>[BASE_URL]</string>
        <key>clientId</key>
        <string>[CLIENT_ID]</string>
    </dict>
</dict>
</plist>
```

Android
Update `strings.xml` with your credentials:

```xml
<resources>
    <string name="transmit_security_client_id">[CLIENT_ID]</string>
    <string name="transmit_security_base_url">[BASE_URL]</string>
</resources>
```

For native biometrics, add the following strings to customize the biometric authentication dialog:

```xml
<resources>
    <string name="BiometricPromptTitle">Authenticate with Biometrics</string>
    <string name="BiometricPromptSubtitle">Use your device biometrics to authenticate.</string>
    <string name="BiometricPromptCancel">Cancel</string>
</resources>
```

Initialize the SDK:

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

TSAuthenticationSDKModule.initializeSDK();
```

Alternatively, initialize with explicit parameters:

```javascript
TSAuthenticationSDKModule.initialize('YOUR_CLIENT_ID');
```

Configure the base server URL based on your region:

| Region | Base URL |
|  --- | --- |
| US | `https://api.transmitsecurity.io/` |
| EU | `https://api.eu.transmitsecurity.io/` |
| Canada | `https://api.ca.transmitsecurity.io/` |
| Sandbox | `https://api.sbx.transmitsecurity.io/` |
| Custom domain | `https://<your-domain>.com/` (see [Custom domains](/guides/deployment/custom_domains)) |