Lighthouse is a suite of player-facing responsible gaming modules that help operators deliver engaging and effective responsible gaming experiences.
Integrated closely with Mentor, Lighthouse captures and analyzes player interactions to provide additional behavioral insights for risk determination. These insights are visualized alongside other player activities, enabling operators to better understand player behavior, monitor engagement, and measure the impact of responsible gaming initiatives.
npm install @neccton-gmbh/lighthouse-web
pnpm add @neccton-gmbh/lighthouse-web
yarn add @neccton-gmbh/lighthouse-web
Via CDN (no bundler required):
<script src="https://cdn.jsdelivr.net/npm/@neccton-gmbh/lighthouse-web/dist/lighthouse.min.iife.js"></script>
The global object is available as LighthouseSDK.
Requires Android 7.0 (API level 24) or later and JDK 17.
The public distribution repository is:
https://github.com/neccton-GmbH/lighthouse-sdk-android-dist
Add the Lighthouse Maven repository to your project's settings.gradle.kts:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven(url = "https://raw.githubusercontent.com/neccton-GmbH/lighthouse-sdk-android-dist/main/maven")
}
}
Then add the SDK to your app module's build.gradle.kts:
dependencies {
implementation("ai.neccton:lighthouse-sdk:<latest-version>")
}
Requires iOS 16 or later and Xcode 15 or later (Swift 5.9).
The public distribution repository is:
https://github.com/neccton-GmbH/lighthouse-sdk-ios-dist
In Xcode, choose File → Add Package Dependencies, enter the package URL above, choose the latest release, then add the LighthouseSDK product to your app target.
For a Swift Package, add the dependency to Package.swift:
.package(
url: "https://github.com/neccton-GmbH/lighthouse-sdk-ios-dist",
from: "<latest-version>"
)
The SDK uses a two-token system:
Your backend is responsible for obtaining a refresh token for a given customer and forwarding it to your frontend. The SDK handles everything after that.
Your frontend → Your backend → Neccton Mentor PIC API
POST /api/v1/authentication/refreshToken
{ apiKey, customerId }
← refresh token (valid 7 days)
← refresh token
A minimal backend endpoint (Node/Express example):
app.get("/api/lighthouse-token", async (req, res) => {
const response = await fetch("https://v3.mentor.neccton.ai/pic/api/v1/authentication/refreshToken", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
apiKey: process.env.NECCTON_API_KEY,
customerId: req.user.customerId,
}),
});
const { refreshToken } = await response.json();
res.json({ refreshToken });
});
Fetch a refresh token from your backend and pass it to the SDK. The SDK refreshes its access token automatically. If the refresh token expires, it dispatches refreshTokenExpired; fetch a replacement from your backend and initialize a new session.
import { LighthouseSession } from "@neccton-gmbh/lighthouse-web";
async function fetchRefreshToken(): Promise<string> {
const res = await fetch("/api/lighthouse-token");
const { refreshToken } = await res.json();
return refreshToken;
}
let session = await LighthouseSession.initialize(await fetchRefreshToken(), {
env: "prod",
});
session.addEventListener("refreshTokenExpired", async () => {
session = await LighthouseSession.initialize(await fetchRefreshToken(), { env: "prod" });
});
Initialize Lighthouse from a coroutine. The SDK exchanges the refresh token for an access token and refreshes that access token automatically.
import ai.neccton.lighthouse.Environment
import ai.neccton.lighthouse.InitializeOptions
import ai.neccton.lighthouse.LighthouseSession
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.launch
private var session: LighthouseSession? = null
fun initializeLighthouse() {
viewModelScope.launch {
session?.destroy()
session = LighthouseSession.initialize(
refreshToken = fetchRefreshTokenFromBackend(),
options = InitializeOptions(env = Environment.PROD),
onRefreshTokenExpired = ::initializeLighthouse,
)
}
}
When you permanently replace or no longer need a session, call destroy() to cancel its internal token-refresh work.
session?.destroy()
session = null
Initialize Lighthouse from an asynchronous context, such as a SwiftUI Task. The SDK exchanges the refresh token for an access token and refreshes that access token automatically.
import LighthouseSDK
@MainActor
final class LighthouseSessionStore {
private(set) var session: LighthouseSession?
func initializeLighthouse() {
Task {
do {
let refreshToken = try await fetchRefreshTokenFromBackend()
let newSession = try await LighthouseSession.initialize(
refreshToken: refreshToken,
options: InitializeOptions(env: .prod),
onRefreshTokenExpired: { [weak self] in
Task { @MainActor in
self?.initializeLighthouse()
}
}
)
session = newSession
} catch {
// Handle initialization failure.
}
}
}
}
| Setting | Web SDK | Android SDK | iOS SDK | Default and description |
|---|---|---|---|---|
| Environment | env: "pre-dev" \| "dev" \| "stage" \| "prod" |
env: Environment.PRE_DEV \| Environment.DEV \| Environment.STAGE \| Environment.PROD |
env: .preDev \| .dev \| .stage \| .prod |
Production by default: "prod", Environment.PROD, or .prod |
| Base URL | baseUrl: string |
baseUrl: String? |
baseURL: URL? |
Overrides the selected environment, for example for local development |
| Language | language: string |
language: String? |
language: String? |
ISO 639-1 code; derived from the browser or device locale, falling back to "en" |
| Country | country: string |
country: String? |
country: String? |
ISO 3166-1 alpha-2 code; derived from the browser or device locale, falling back to "ZZ" |
All methods throw ApiError on non-2xx responses.
import { ApiError } from "@neccton-gmbh/lighthouse-web";
try {
await session.markMessageRead(messageId);
} catch (err) {
if (err instanceof ApiError) {
console.error(err.status, err.message);
}
}
SDK calls are suspend functions and throw ApiError on non-success HTTP responses.
import ai.neccton.lighthouse.ApiError
import android.util.Log
try {
session?.markMessageRead(messageId)
} catch (error: ApiError) {
Log.e("Lighthouse", "Request failed: ${error.status}", error)
}
SDK calls are asynchronous and throw APIError on non-success HTTP responses.
import LighthouseSDK
do {
try await session.markMessageRead(messageId)
} catch let error as APIError {
print("Request failed: \(error.status) - \(error.message)")
}
Engagements provide a customer's play breaks, time limits, and money limits. Each resource is available as complete history or as the currently active records. Engagement lists use zero-based pages; limit is between 1 and 10 and defaults to 10.
| Method | Returns |
|---|---|
session.playBreaks() / session.activePlayBreaks() |
All / active play breaks |
session.timeLimits() / session.activeTimeLimits() |
All / active time limits |
session.moneyLimits() / session.activeMoneyLimits() |
All / active money limits |
Use the all-record methods for a history view and the active methods for the currently applicable protection settings. Each accepts the same paging options.
const result = await session.activePlayBreaks({ page: 0, limit: 10 });
for (const playBreak of result.data) {
console.log(playBreak.playBreakStart, playBreak.playBreakEnd);
}
const timeLimits = await session.timeLimits({ page: 1, limit: 10 });
const moneyLimits = await session.activeMoneyLimits();
import ai.neccton.lighthouse.EngagementListOptions
val result = session.activeTimeLimits(
EngagementListOptions(page = 0, limit = 10),
)
result.data.forEach { timeLimit ->
println("${timeLimit.value} ${timeLimit.period}")
}
val playBreaks = session.playBreaks()
val moneyLimits = session.activeMoneyLimits()
import LighthouseSDK
let result = try await session.activeMoneyLimits(
options: EngagementListOptions(page: 0, limit: 10)
)
for moneyLimit in result.data {
print(moneyLimit.value, moneyLimit.currency?.currencyCode)
}
let playBreaks = try await session.playBreaks()
let timeLimits = try await session.activeTimeLimits()
| Field | Description |
|---|---|
picInternalPlayBreakId |
Lighthouse play-break identifier |
eventId / eventTimestamp |
Source event identifier and timestamp |
playBreakStart / playBreakEnd |
Break start and end timestamps |
durationMinutes |
Duration in minutes |
initiator |
CUSTOMER, OPERATOR, or SYSTEM |
| Field | Description |
|---|---|
picInternalTimeLimitId |
Lighthouse time-limit identifier |
eventId / eventTimestamp |
Source event identifier and timestamp |
startDate / endDate |
Start date and optional end date |
period |
DAILY, WEEKLY, MONTHLY, SESSION, or CUSTOM |
value |
Configured limit value |
customLimitDuration |
Duration for CUSTOM limits |
initiator |
CUSTOMER, OPERATOR, or SYSTEM |
| Field | Description |
|---|---|
picInternalMoneyLimitId |
Lighthouse money-limit identifier |
eventId / eventTimestamp |
Source event identifier and timestamp |
type |
DEPOSIT, NET_DEPOSIT, LOSS, STAKE, or BALANCE |
startDate / endDate |
Start date and optional end date |
period |
DAILY, WEEKLY, MONTHLY, SESSION, or CUSTOM |
value |
Configured monetary amount |
currency |
ISO currency code and, where supplied, currency metadata |
customLimitDuration |
Duration for CUSTOM limits |
initiator |
CUSTOMER, OPERATOR, or SYSTEM |
Fields that do not apply to an active engagement can be absent or null. Check values before rendering dates, values, and currency information. Every list returns data, currentPage, totalPages, totalItems, pageSize, hasNext, and hasPrevious.
Use hasNext and hasPrevious to enable pagination controls. Request the next or previous zero-based page with the same limit.
Risk score timelines return historical scores for either responsible gaming (RG) or anti-money laundering (AML). The response maps date strings to numeric scores and can include empty when no score data is available.
const timeline = await session.riskScoreTimeline("RG");
if (!timeline.empty) {
for (const [date, score] of Object.entries(timeline)) {
if (date !== "empty") console.log(date, score);
}
}
import ai.neccton.lighthouse.RiskScoreArea
val timeline = session.riskScoreTimeline(RiskScoreArea.RG)
timeline.entries.forEach { (date, score) -> println("$date: $score") }
import LighthouseSDK
let timeline = try await session.riskScoreTimeline(.rg)
for (date, score) in timeline.entries {
print("\(date): \(score)")
}
The Web SDK keeps the API's date keys directly on the returned object. Android and iOS expose the same values as entries maps. The empty flag is optional in every SDK.
| API value | Web SDK | Android SDK | iOS SDK |
|---|---|---|---|
Score for 2026-10-19 |
timeline["2026-10-19"] |
timeline.entries["2026-10-19"] |
timeline.entries["2026-10-19"] |
| No data flag | timeline.empty |
timeline.empty |
timeline.empty |
Customer KPIs return values for the individual customer and a comparable customer group. Available keys are DEPOSIT_AMOUNT, WITHDRAWAL_AMOUNT, ACTIVE_DAYS, PLAYING_DURATION, PLAYING_DURATION_NIGHT, and BET_AVERAGE.
const [customer, comparable] = await Promise.all([
session.customerKpi("DEPOSIT_AMOUNT"),
session.comparableCustomerKpi("DEPOSIT_AMOUNT"),
]);
console.log(customer.TODAY, comparable.THIS_WEEK);
import ai.neccton.lighthouse.KpiKey
val customer = session.customerKpi(KpiKey.DEPOSIT_AMOUNT)
val comparable = session.comparableCustomerKpi(KpiKey.DEPOSIT_AMOUNT)
import LighthouseSDK
async let customer = session.customerKpi(.depositAmount)
async let comparable = session.comparableCustomerKpi(.depositAmount)
let (customerKpi, comparableKpi) = try await (customer, comparable)
Fetch customer and comparable KPIs independently. If a comparable value is unavailable, still show the customer's value rather than treating the complete KPI view as failed.
| API field | Android / iOS property | Meaning |
|---|---|---|
TODAY |
today |
Current day |
THIS_WEEK |
thisWeek |
Current week |
THIS_MONTH |
thisMonth |
Current month |
ALL_TIME |
allTime |
All available history |
KPI period values are optional. Check that a value is present before displaying it or using it in calculations.
| Key | Measures |
|---|---|
DEPOSIT_AMOUNT |
Deposits |
WITHDRAWAL_AMOUNT |
Withdrawals |
ACTIVE_DAYS |
Active playing days |
PLAYING_DURATION |
Playing duration |
PLAYING_DURATION_NIGHT |
Playing duration at night |
BET_AVERAGE |
Average bet |
Use the same key for customerKpi and comparableCustomerKpi when comparing the customer with the reference group.
Game distributions show how a customer's KPI is distributed across game categories and types. The API currently supports BET_AMOUNT for THIS_WEEK and THIS_MONTH.
Use the corresponding SDK method:
session.gameDistribution("BET_AMOUNT", "THIS_MONTH")session.gameDistribution(GameDistributionKpi.BET_AMOUNT, GameDistributionPeriod.THIS_MONTH)try await session.gameDistribution(.betAmount, period: .thisMonth)Each item contains a configured category, type, and numeric value. Current categories are SPORT, LOTTERY, BINGO, POKER, CASINO, and SLOT; do not infer a fixed relationship between a category and type, because the available game types can expand.