Mobile Apps
Collect the encrypted device payload with the native SDK and forward it to your backend to register the login event with SmartID.
Before integrating, install the SDK in Getting Started → Install the SDK →
GetRawData
Collects device fingerprint data asynchronously and returns it encoded. Call this just before the user submits the login form.
SmartId
.getInstance()
.GetRawData(getApplicationContext(), "https://your-backend.com")
.onSuccess { time, response ->
// response: encoded device payload
// forward to your backend alongside user credentials
}
.onFailure { time, message, errorCode ->
// still submit the login — send data as empty string
}
.start() SID.shared.startLocation()
SID.shared
.getRawData("https://your-backend.com")
.onSuccess(success: { time, encodedData in
// encodedData: encoded device payload
// forward to your backend alongside user credentials
})
.onFailure(failure: { time, message, errorCode in
// still submit the login — send data as empty string
})
.start() // Just before form submission
SmartID.getRawData(
applicationBackendDomain: 'https://your-backend.com',
)
.onSuccess((time, response) {
// response: encoded device payload
// forward to your backend alongside user credentials
})
.onFailure((time, message, errorCode) {
// still submit the login — send data as empty string
})
.start() import { SmartID } from 'capacitor-smartid';
// iOS only — initialize GPS sensor
await SmartID.startLocation();
try {
const result = await SmartID.getRawData({
backendDomain: 'https://your-backend.com'
});
// result.data: encoded device payload
// forward to your backend alongside user credentials
} catch (error) {
// still submit the login — send data as empty string
} Method parameters
| Parameter | Platform | Type | Description |
|---|---|---|---|
context | Android | Context | Application context. Required. |
applicationBackendDomain (backendDomain on Capacitor) | All | String | Your backend URL. Optional. Used for SSL pinning and pharming detection. |
Callback parameters
| Parameter | Callback | Type | Description |
|---|---|---|---|
time | Success / Failure | Long | Execution duration in milliseconds |
response | Success | String | Encrypted device payload. Send as-is to the data field of the API. |
message | Failure | String | Error description |
errorCode | Failure | Int | Error code |
If the SDK returns a Failure callback, you must still send the login request to your backend, but with an empty data field.
Complete login flow
The SDK runs on the client. Only your backend calls the SmartID API.
App calls GetRawData
Android/iOS/Flutter: in the onSuccess callback, the response parameter contains the encrypted payload. Capacitor: the result is in result.data from the try block. Hold it until the user submits the form.
App sends credentials + payload to your backend
Include the response value alongside username and password in your request to your own server. If the SDK failed, use an empty string.
Your backend calls the SmartID API
Your server POSTs the login event to SmartID with the user attributes and encrypted payload.
/api/v5/analytics/app/login curl -X POST https://<api-url>/api/v5/analytics/app/login \\
-H "Content-Type: application/json" \\
-H "Authorization: Bearer <license>" \\
-d '{
"channelId": 2,
"user": "jlopez",
"session": "445613456fa",
"publicIp": "20.201.64.54",
"data": "<response from GetRawData, empty string on failure>"
}' | Field | Type | Required | Description |
|---|---|---|---|
channelId | integer | Required | Your SmartID channel identifier |
user | string | Required | Username or unique user identifier |
session | string | Optional | Your application session token |
publicIp | string | Required | User's public IP address |
data | string | Required | Encrypted payload from GetRawData. Empty string if SDK failed. |
SmartID returns 200 OK
SmartID logs the event and responds with 200 OK. Proceed with your normal login logic.
Logout
When the user logs out, notify SmartID from your backend. No SDK call is needed from the client.
/api/v5/analytics/app/logout curl -X POST https://<api-url>/api/v5/analytics/app/logout \\
-H "Content-Type: application/json" \\
-H "Authorization: Bearer <license>" \\
-d '{
"channelId": 2,
"user": "jlopez",
"session": "445613456fa"
}' publicIp and data are optional on logout. channelId, user, and session are sufficient to close the event.