open-index/open-npm huggingface dataset:
npm package: @sentinelux/sdk
Description: SentinelUX SDK - Embeddable script for external projects
Latest version: 0.1.0

# @sentinelux/sdk

Embeddable SDK to integrate external projects with SentinelUX dashboard.

## Installation

```bash
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
<script src="https://sentinelux.app/sdk.js"></script>
<script>
  SentinelUX.init({
    projectId: 'your-project-id',
    apiKey: 'your-api-key',
    autoRecord: true, // Automatically record user sessions
  });
</script>
```

### Manual Recording

```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

### SentinelUX (Node.js)

| 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 |

### SentinelUXBrowser

| 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) |
npm package: @sentinelweb/frontend-agent
Description: SentinelWeb Frontend Agent for real-time user activity monitoring and security tracking
Author: Jayesh
Latest version: 1.0.0

# 🛡️ SentinelWeb Frontend Agent

[![npm version](https://img.shields.io/npm/v/@sentinelweb/frontend-agent.svg)](https://www.npmjs.com/package/@sentinelweb/frontend-agent)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

> A lightweight, privacy-first JavaScript SDK for monitoring DOM anomalies, user behaviors, and client-side security threats in real-time.

---

## 🚀 Installation

```bash
npm install @sentinelweb/frontend-agent
```

## ⚡ Quickstart

The absolute minimum code required to integrate the agent into your frontend React, Vue, or Vanilla setup.

```javascript
import { SentinelWebFrontend } from '@sentinelweb/frontend-agent';

const agent = new SentinelWebFrontend({
  apiEndpoint: 'https://your-api.com/collect/frontend'
});

// Starts listening to DOM metrics, security events, and performance vitals silently
agent.start();
```

*For direct HTML script-tag integration:*
```html
<script>
  window.SentinelWebConfig = { apiEndpoint: 'https://your-api.com/collect/frontend' };
  window.SentinelWebAutoStart = true;
</script>
<script src="https://unpkg.com/@sentinelweb/frontend-agent/dist/index.umd.js"></script>
```

## ⚙️ Configuration API

When instantiating `SentinelWebFrontend(config)`, pass an object with the following properties:

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `apiEndpoint` | `string` | **Required** | The Collector API endpoint URL where telemetry should be sent. |
| `collectInterval` | `number` | `5000` | Milliseconds between background batch transmissions. |
| `debug` | `boolean` | `false` | Enable local console debug logging. |
| `enabledFeatures` | `object` | `all enabled` | Feature toggles (`domEvents`, `performanceMonitoring`, `userBehavior`, `securityEvents`, `errorTracking`, `networkMonitoring`). |
| `privacy.maskSensitiveData` | `boolean` | `true` | Automatically scramble sensitive input values (like passwords/SSNs) locally. |
| `privacy.excludeSelectors` | `Array` | `['input[type="password"]']` | HTML/CSS selectors that the SDK should completely ignore tracking. |
| `privacy.anonymizeIPs` | `boolean` | `true` | Hash and prevent raw IP address persistence natively. |
| `privacy.respectDoNotTrack`| `boolean` | `true` | Turn off all telemetry if the browser sets the DNT header. |

## 🤝 Contributing

We welcome community contributions to SentinelWeb!

1. **Clone the repository:**
   ```bash
   git clone https://github.com/jayesh-bhai/SentinelWeb.git
   ```
2. **Setup Locally:**
   ```bash
   cd SentinelWeb/agents/frontend-agent
   npm install
   ```
3. **Build the Agent Bundle:**
   ```bash
   npm run build
   ```
4. **Submit a Pull Request:** 
   Open a PR on our [GitHub Repository](https://github.com/jayesh-bhai/SentinelWeb). If you find a security flaw or bug, please open an Issue first!

## 📄 License
This project is licensed under the [MIT License](LICENSE).