To use the dtect Security API you need to install one of our Frontend SDKs and initialize it with the right configuration.
Each call to the SDK requires specific fields depending on which method you use.
Initialization (init()
)#
Init must be complete to call any other method. When you initialize the SDK, you must provide:Field | Required | Description |
---|
clientId | ✅ | The Public Client ID representing your application. |
apiKey | ✅ | The Public API Key used to authenticate requests from the frontend. |
includeResults | ❌ | Controls whether results for AI Usage Detection and Quality Questions are returned to the frontend or only available on your backend. Defaults to false . |
clientId
and apiKey
are always required. includeResults
is optional and only affects AI Usage Detection and Quality Questions.
SDK Methods#
getSecurityToken / getSecurityResult#
These methods are used to generate a Security Token or retrieve a Security Result.Field | Required | Description |
---|
projectId | ✅ | A unique identifier for a project, study, or survey. Used for deduplication checks. |
visitorId | ❌ | An ID for the visitor being evaluated. If not provided, the isDuplicateId check will always return false . |
metaData | ❌ | Any additional information you want to attach to the request. |
securitySettings | ❌ | Customize the security checks. |
securitySettings.countriesAllowed | ❌ | List of allowed countries in lowercase ISO alpha-3 codes. If not provided, the isLocationBlocked check will always return false . |
isAIUsageDetected#
Checks whether AI tools or behavior patterns were detected for the visitor.Field | Required | Description |
---|
projectId | ✅ | A unique identifier for a project, study, or survey. Used for deduplication checks. |
visitorId | ❌ | An ID for the visitor being evaluated. |
checkQualityQuestions#
Validates a visitor’s answers against quality control questions.Field | Required | Description |
---|
projectId | ✅ | A unique identifier for a project, study, or survey. Used for deduplication checks. |
questions | ✅ | List of question/answer objects to validate. |
visitorId | ❌ | An ID for the visitor being evaluated. |
getQualityQuestions#
Retrieves 4 randomized quality questions (3 single/multi-select + 1 open-ended).
Learn More#