open-index/open-npm huggingface dataset:
npm package: @lukestei/embed
Description: Embeddable visitor engagement widget
Latest version: 0.1.11

# Embed Widget

## Features

- **Visitor Management**: Token validation, visitor initialization, and session tracking
- **Real-time Updates**: Server-sent events for live status updates
- **Video Calling**: Daily.co integration for video calls
- **Page Visibility**: Automatic activity tracking based on page visibility

## Development

### Prerequisites

- Node.js 18+ 
- npm or yarn

### Setup

1. Install dependencies:
```bash
npm install
```

2. Start development server:
```bash
npm run dev
```

3. Build for production:
```bash
npm run build
```

The built files will be in the `dist/` directory.

## Usage

The embed widget can be included in any website by adding a script tag:

```html
<script src="https://cdn.jsdelivr.net/gh/lukesteinbicker/embed@main/embed.js?token=your_embed_token"></script>
```

Or with a data attribute:

```html
<script src="https://cdn.jsdelivr.net/gh/lukesteinbicker/embed@main/embed.js" data-token="your_embed_token"></script>
```

## API Integration

The widget integrates with the following API endpoints:

- `POST /api/visitors/initialize` - Initialize visitor session
- `GET /api/visitors/status` - Get current visitor status
- `POST /api/visitors/status` - Update visitor status
- `GET /api/visitors/events?visitorId={visitorId}` - Server-sent events stream