> For the complete documentation index, see [llms.txt](https://docs.talsec.app/freerasp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talsec.app/freerasp/freerasp/integration/capacitor/api.md).

# API

## Types

### `TalsecConfig`

Specifies configuration for your app. See the table below for detailed description of the attributes.

<table><thead><tr><th width="154">field</th><th width="150">type</th><th width="234">description</th><th>sample value</th></tr></thead><tbody><tr><td>androidConfig</td><td>AndroidConfig?</td><td>Configuration for Android apps</td><td><em>any</em> <em>AndroidConfig instance</em></td></tr><tr><td>iosConfig</td><td>IOSConfig?</td><td>Configuration for iOS apps</td><td><em>any</em> <em>IOSConfig instance</em></td></tr><tr><td>watcherMail</td><td>string</td><td><p>The value is automatically used for Security Reports, Product Updates, and Talsec Portal updates, <a href="/pages/nXeUfFQHrJJCKXvo5ytH">learn more</a>.</p><p> Mail has a strict form <code>'name@domain.com'</code>.</p></td><td>'<code>john@example.com'</code></td></tr><tr><td>isProd</td><td>boolean?</td><td>Defaults to <code>true</code> when undefined. If you want to use the Dev version to make the development process easier, set the parameter to <code>false</code>. Make sure that you have the Release version in the production (i.e. isProd set to true)!. To simplify switching between debug and release version of freeRASP based on the build type, you can use <code>BuildConfig.BUILD_TYPE.contains("Release", true)</code> as a value for <code>isProd</code>.</td><td><code>true</code></td></tr><tr><td>killOnBypass</td><td>boolean?</td><td><p>Defaults to <code>false</code> .</p><p></p><p>Determines whether the app should be killed within the SDK, if the callbacks are hooked or modified by an attacker.</p></td><td><code>true</code></td></tr></tbody></table>

### `TalsecAndroidConfig`

Specifies configuration for instances of the app running on Android devices. See the table below for detailed description of the attributes.

<table><thead><tr><th width="179">field</th><th width="91">type</th><th width="265">description</th><th>sample value</th></tr></thead><tbody><tr><td>packageName</td><td>string</td><td>Package name of the app.</td><td>'<code>com.talsec.freerasp.demoapp'</code></td></tr><tr><td>certificateHashes</td><td>string[]</td><td>Certificate hashes of your app.</td><td><code>['mVr/qQLO8DKTwqlL+B1qigl9NoBnbiUs8b4c2Ewcz0k=']</code></td></tr><tr><td>supportedAlternativeStores</td><td>string[]</td><td>Package names of the alternative stores. If you publish on the Google Play Store and Huawei AppGallery, as these are already included internally. (You can assign just <code>emptyArray()).</code> For more information, visit the <a href="https://github.com/talsec/Free-RASP-Community/wiki/Threat-detection#detecting-unofficial-installation">Detecting Unofficial Installation</a> wiki page.</td><td>[ <code>'com.sec.android.app.samsungapps']</code></td></tr></tbody></table>

### `TalsecIosConfig`

Specifies configuration for instances of the app running on iOS devices. See the table below for detailed description of the attributes.

<table><thead><tr><th width="144">field</th><th width="94">type</th><th>description</th><th>sample value</th></tr></thead><tbody><tr><td>appBundleId</td><td>string</td><td>Apple Bundle ID for the app</td><td>'<code>com.talsec.freerasp.demoapp'</code></td></tr><tr><td>appTeamId</td><td>string</td><td>Apple Team ID used in the app</td><td>'M8AK35...'</td></tr></tbody></table>

### `ThreatEventActions`

Specifies a set of callbacks that are used to notify the application when certain security threat is detected.

#### Actions

<table><thead><tr><th width="316">threat</th><th width="267">type</th><th width="96" data-type="checkbox">Android</th><th width="84" data-type="checkbox">iOS</th><th data-hidden>description</th></tr></thead><tbody><tr><td><code>privilegedAccess</code></td><td>() => any</td><td>true</td><td>true</td><td></td></tr><tr><td><code>debug</code></td><td>() => any</td><td>true</td><td>true</td><td></td></tr><tr><td><code>simulator</code></td><td>() => any</td><td>true</td><td>true</td><td></td></tr><tr><td><code>appIntegrity</code></td><td>() => any</td><td>true</td><td>true</td><td></td></tr><tr><td><code>unofficialStore</code></td><td>() => any</td><td>true</td><td>true</td><td></td></tr><tr><td><code>hooks</code></td><td>() => any</td><td>true</td><td>true</td><td></td></tr><tr><td><code>deviceBinding</code></td><td>() => any</td><td>true</td><td>true</td><td></td></tr><tr><td><code>deviceID</code></td><td>() => any</td><td>false</td><td>true</td><td></td></tr><tr><td><code>passcode</code></td><td>() => any</td><td>true</td><td>true</td><td></td></tr><tr><td><code>secureHardwareNotAvailable</code></td><td>() => any</td><td>true</td><td>true</td><td></td></tr><tr><td><code>obfuscationIssues</code></td><td>() => any</td><td>true</td><td>false</td><td></td></tr><tr><td><code>devMode</code></td><td>() => any</td><td>true</td><td>false</td><td></td></tr><tr><td><code>adbEnabled</code></td><td>() => any</td><td>true</td><td>false</td><td></td></tr><tr><td><code>systemVPN</code></td><td>() => any</td><td>true</td><td>true</td><td></td></tr><tr><td><code>malware</code></td><td>(apps: SuspiciousAppInfo[]) => any</td><td>true</td><td>false</td><td></td></tr><tr><td><code>screenshot</code></td><td>() => any</td><td>true</td><td>true</td><td></td></tr><tr><td><code>screenRecording</code></td><td>() => any</td><td>true</td><td>true</td><td></td></tr><tr><td><code>multiInstance</code></td><td>() => any</td><td>true</td><td>false</td><td></td></tr><tr><td><code>timeSpoofing</code></td><td>() => any</td><td>true</td><td>true</td><td></td></tr><tr><td><code>locationSpoofing</code></td><td>() => any</td><td>true</td><td>false</td><td></td></tr><tr><td><code>unsecureWifi</code></td><td>() => any</td><td>true</td><td>false</td><td></td></tr><tr><td><code>automation</code></td><td>() => any</td><td>true</td><td>false</td><td></td></tr></tbody></table>

### `RaspExecutionStateEventActions`

Specifies a set of callbacks that are used to notify the application about the state of freeRASP execution.

<table><thead><tr><th width="316">field</th><th width="267">type</th><th width="96" data-type="checkbox">Android</th><th width="84" data-type="checkbox">iOS</th><th data-hidden>description</th></tr></thead><tbody><tr><td><code>allChecksFinished</code></td><td>() => any</td><td>true</td><td>true</td><td></td></tr></tbody></table>

## Methods

#### `const startFreeRASP = async (config: TalsecConfig, actions: ThreatEventActions, raspExecutionStateActions?: RaspExecutionStateEventActions): Promise<{ started: boolean }>`

* Method is used to start freeRASP's audit and set up listeners for threats. Returns `{ started: true }` when successful.

#### `const removeThreatListener`

* Unregisters threat listeners. Should be called only when the app is being terminated.

#### `const blockScreenCapture`

* Enables or disables screen capture blocking (Android only).

#### `const isScreenCaptureBlocked`

* Checks if screen capture is currently blocked (Android only).

#### `const storeExternalId`

* Stores an external ID (e.g., User ID) to be sent with reports to the Talsec Dashboard.

#### `const removeExternalId`

* Removes the stored external ID.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.talsec.app/freerasp/freerasp/integration/capacitor/api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
