Client SDK & Open API Documentation
Integrate the Emontrai lightweight telemetry plugin into your ERP, CRM, or portal in less than 15 minutes. High-throughput ingestion, zero-PII guarantee, and sub-millisecond gateway response.
1. One-Line Script Installation
Copy and paste this single line snippet into your website master template (e.g. Next.js, Blade, Django, WordPress, or custom portal):
<!-- 1. Paste this script tag into the <head> or <body> of your internal ERP/CRM -->
<script
src="https://cdn.emontrai.com/v1/sdk.js"
data-api-key="YOUR_TENANT_API_KEY"
data-mask-pii="true"
data-environment="production"
async>
</script>2. Pseudonymous Telemetry Identification (Zero-PII)
When an employee logs into your internal ERP/CRM, provide their non-sensitive department and role context so your executive dashboard can calculate department-level friction:
// 2. Optional: Identify current user context pseudonymously (Zero-PII)
window.EmontraiSDK = window.EmontraiSDK || [];
window.EmontraiSDK.push(['identify', {
employeeHash: 'usr_84920fe', // Random hash or employee ID in your ERP
department: 'Finance', // Division name
role: 'Invoicing Specialist', // Job role
branch: 'HQ-Jakarta' // Optional branch/region
}]);
// 3. Track custom business task completion time
const timer = window.EmontraiSDK.startTask('Purchase_Order_Approval');
// ... staff performs review and submits ...
timer.finish({ status: 'success' });3. Automatic Rage Click Detection & Friction Widget
The Emontrai client plugin continuously monitors user frustration patterns without recording sensitive data. When an employee clicks an unresponsive button repeatedly (≥3 clicks within 500ms), a rage-click anomaly is flagged automatically:
// Rage click detection is activated automatically upon script load!
// Optional: Customize friction threshold and floating widget
window.EmontraiSDK.config({
rageClickThreshold: 3, // Clicks required to trigger alert
rageClickWindowMs: 500, // Detection timeframe in milliseconds
showFeedbackWidget: true, // Floating 1-click "Lapor Kendala" button
});Does not interrupt the employee workflow. Events are batched in memory and dispatched every 5 seconds.
Only records DOM element tags (e.g., `BUTTON#btn-submit`) and timestamps. Never reads form inputs or text content.
Klik tombol di samping secara cepat (≥3 kali dalam 500 milidetik) untuk melihat simulasi penangkapan Rage Click:
4. Direct Ingestion Open API Endpoint
For backend workflows or automated batch telemetry, transmit events directly to our API Gateway:
curl -X POST https://api.emontrai.com/v1/telemetry/events \
-H "Content-Type: application/json" \
-H "X-API-Key: opsk_live_acme_928df73a90c1284739ab" \
-d '{
"timestamp": "2026-09-19T14:30:00Z",
"batch": [
{
"type": "workflow_step",
"task_name": "PO_Approval",
"duration_ms": 4820,
"sla_target_ms": 2000,
"rage_click_count": 0,
"department": "Finance"
}
]
}'{ "status": "queued", "accepted_events": 1, "processing_cluster": "gplay-core-01" }