SentinelUX SDK - Embeddable script for external projects
npm install @sentinelux/sdkbash
npm install @sentinelux/sdk
or
bun add @sentinelux/sdk
`
Usage (Node.js / TypeScript)
`typescript
import { SentinelUX } from '@sentinelux/sdk';
const sentinel = new SentinelUX({
projectId: 'your-project-id',
apiKey: 'your-api-key',
serverUrl: 'https://sentinelux.app', // or your self-hosted URL
});
// Send analysis results
await sentinel.sendAnalysis({
schemas: detectedSchemas,
functions: detectedFunctions,
generatedTests: tests,
});
// Send test results
await sentinel.sendTestResults({
results: testResults,
summary: { total: 10, passed: 8, failed: 2, skipped: 0 },
duration: 5000,
});
`
Browser Script Tag
Add to your HTML:
`html
`
$3
`javascript
// Start recording
SentinelUX.startRecording();
// Track custom events
SentinelUX.track('checkout_started', { cartValue: 99.99 });
// Stop recording
SentinelUX.stopRecording();
// Send test results
SentinelUX.sendTestResults({
passed: 5,
failed: 1,
total: 6,
});
`
API Reference
$3
| Method | Description |
|--------|-------------|
| sendAnalysis(data) | Send project analysis results |
| sendTestResults(results) | Send test execution results |
| sendSecurityScan(scan) | Send security scan results |
| sendChecklist(checklist) | Send pre-ship checklist results |
| startSession(name?) | Start a recording session |
| sendActions(actions) | Send captured actions |
| endSession() | End the current session |
$3
| Method | Description |
|--------|-------------|
| init(config) | Initialize the SDK |
| startRecording() | Start auto-recording |
| stopRecording() | Stop recording |
| track(event, props?) | Track custom event |
| sendTestResults(results) | Send test results |
Configuration
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| projectId | string | required | Your SentinelUX project ID |
| apiKey | string | required | API key for authentication |
| serverUrl | string | https://sentinelux.app | Server URL |
| debug | boolean | false | Enable debug logging |
| autoRecord | boolean | false` | Auto-start recording (browser only) |