Emontrai Logo
Emontrai.Ops-Perf
Developer Integration Guide

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. 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"
      }
    ]
  }'
Response (202 Accepted):{ "status": "queued", "accepted_events": 1, "processing_cluster": "gplay-core-01" }