> This page is for version 2021-07-05.
> For other versions, use one of these documentation indexes:
> - 2026-09-29 (default): https://docs.withpersona.com/2026-09-29/llms.txt
> - 2025-12-08: https://docs.withpersona.com/2025-12-08/llms.txt
> - 2025-10-27: https://docs.withpersona.com/2025-10-27/llms.txt
> - 2023-01-05: https://docs.withpersona.com/2023-01-05/llms.txt
> - 2022-09-01: https://docs.withpersona.com/2022-09-01/llms.txt
> - 2021-07-05: https://docs.withpersona.com/2021-07-05/llms.txt
> - 2021-05-14: https://docs.withpersona.com/2021-05-14/llms.txt
> - 2020-05-18: https://docs.withpersona.com/2020-05-18/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.withpersona.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.withpersona.com/_mcp/server.

# Sentinel Android Integration Guide

This guide covers how to add Persona Sentinel SDK to your Android project and how to use the SDK.

## Integration

### Requirements - Make sure the SDK is compatible

Your application needs to have a `minSdkVersion` set to API 23 (Android 6.0, Marshmallow) or higher.

### Dependencies - Adding Persona to your project

In your `app/build.gradle` file (or wherever you plan on using the SDK) include the following:

**`Kotlin DSL`**

```kotlin Kotlin DSL
repositories {
  // ...
  maven {
    url = uri("https://sdk.withpersona.com/android/releases")
  }
}

android {
  // ...
  compileOptions {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
  }
}

dependencies {
  // ...
  implementation("com.withpersona.sdk2:sentinel:X.Y.Z")
  // ...
}
```

**`Groovy`**

```groovy Groovy
repositories {
  // ...
  maven {
    url 'https://sdk.withpersona.com/android/releases'
  }
}

android {
  // ...
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
  }
}

dependencies {
  // ...
  implementation 'com.withpersona.sdk2:sentinel:X.Y.Z'
  // ...
}
```

### Required permissions

Our manifest files declare the following permissions.

**`xml`**

```xml xml
<uses-permission android:name="android.permission.INTERNET" />
```

### Versioning

If you're also using the Inquiries Android SDK, ensure both implementations are using the same SDK version.

## Usage

The Persona Sentinel SDK collects passive signals from customers via events. The following sections describe how to configure and trigger a Sentinel event.

### Triggering a Sentinel Event

The `Sentinel` object is used to build and trigger an event.

**`kotlin`**

```kotlin kotlin
Sentinel
    .newEventBuilder(
        clientToken = CLIENT_TOKEN,
        transactionTypeId = TRANSACTION_TYPE_ID,
    )
    .contextString()  // an optional string
    .identifiers()    // an optional array of strings
    .environmentId()  // an optional Persona environment ID: defaults to your production environment.
    .accountReferenceId("...") // optionally include account reference id for this event
    .autoCreateAccount(true)  // an optional boolean: defaults to true. Controls whether an account is automatically created.
    .autoCreateAccountTypeId("acttp_...")  // an optional account type token: defaults to the transaction type's configured default account type.
    .build()
    .trigger(context)
```

You may trigger events using `trigger(Context)` (preferred) or `triggerAsync()`.

`trigger(Context)` will trigger the event immediately however it is a suspending function. It returns a `kotlin.Result` object which can be used to determine whether the event was logged successfully.

`triggerAsync(context)` also requires a `Context` and will log the event asynchronously without blocking the calling thread.