Quickstart
You can use the Synthient library through the native Javascript library or through one of the available SDKs. Synthient integration is meant to be painless, with a simple setup process. If you require any assistance please contact support.
Get Your API Key
- Under the dashboard, navigate to the API section.
- Click create new API key. From there you can save the key to your clipboard.
- You can now use this key to authenticate with the Synthient API.
Installation
The Synthient agent can be added to your page by embedding the following script tag in your HTML document.
<script id="synthient-public-key" value="YOUR_PUBLIC_KEY" src="https://cdn.synthient.com/client.js"></script>
Initiating the Client
Once you have added the script tag to your page, you can initiate the client by calling the Synthient
function. This function returns a promise which resolves to the Synthient client.
const synthient = await Synthient();
Once you've initiated the client you choose to generate the token thats the right fit for you. Synthient offers three types of tokens. GetMetricsToken
, GetSignToken
, and GetSignToken (strict mode)
. Each of these tokens has a different use case and can be used to enhance the security of your application.
The invisible challenge can be thought of as an invisible captcha. It performs a series of checks in the background to ensure the legitimacy of the visitor. It will not impact the user experience, however the strict sign token will take a few miliseconds longer to solve.
Metrics tokens are encouraged for applications where you are monitoring visitors or need to perform quick lookups. Sign tokens on the other hand are used to validate the legitimacy of a visitor and their interactions with your application. Sign tokens are encouraged for actions such as sending a message, or performing a less sensitive action. Strict tokens are the highest level of security and are encouraged for sensitive actions such as signing up or making a payment. These tokens are heavily enforced and are the most secure option.
Generating a Token
Once you've decided upon the token thats right for your application you can generate the token by calling the appropriate function. The token is returned as a promise that should be sent to your server for validation.
const synthient = await Synthient();
const token = await synthient.GetMetricsToken();
console.log(token); // Consume the token
Monitoring Your Application
Once live, you can monitor your application through the Synthient dashboard. The dashboard provides a detailed overview of your application's traffic and the interactions that are taking place. You can view the number of tokens generated, flagged, device breakdown, and more.