Setup
The first step of integrating Legiti's SDKs into your platform is instantiating the library and passing your API key (which will be provided to you by the Legiti Team) to the Legiti class.
Et voilà! You now have a Legiti client object that is capable of sending all data necessary to teach Legiti's decision layer on how to prevent fraud at your company.

Sandbox API Keys

In the initial stages of your integration, you will need to test out a few endpoints to make sure everything is working. It is important that this data is flagged as test data so our models do not use them for training. You can achieve this by using the Sandbox API key that will be provided to you with the Production API Key.

Setup

Javascript
Kotlin
Swift
React Native
legiti.sharedInstance().setup("${API_KEY}");
import com.legiti.Legiti
try {
Legiti.sharedInstance().setup(authToken="${API_KEY}")
} catch (ex: Exception) {
when (ex) {
is InvalidCredentials -> { print("Error: $ex") }
is ContextNotSetup -> { Legiti.sharedInstance().setContext(context=applicationContext) }
}
}
import Legiti
do {
try Legiti.sharedInstance().setup(authToken: "${API_KEY}")
} catch TrackerException.requiredConfig(let code, let message) {
print("code: \(code) - message: \(message)")
} catch {
print("Error")
}
import { NativeModules } from 'react-native';
const authToken = "${API_KEY}";
NativeModules.Legiti.setup(authToken).catch(e => console.log("Error: ${e}"));
Copy link