Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 0 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,80 +249,6 @@ const {

---

## Migration from V1 to V2

### Before (V1 - WebSocket)

The V1 implementation required manual WebSocket handling:

```javascript
// Complex WebSocket setup
const ws = new WebSocket(CONFIG.MOVERIS_WS_URI);

ws.onopen = () => {
ws.send(JSON.stringify({ type: 'auth', token: SECRET_KEY }));
};

ws.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'auth_success') {
startFrameCapture();
}
// ... handle many message types
};

// Manual frame capture
function captureFrame() {
const canvas = document.createElement('canvas');
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
canvas.getContext('2d').drawImage(video, 0, 0);
return canvas.toDataURL('image/jpeg', 0.7).split(',')[1];
}

// Send frames at interval
setInterval(() => {
const frame = captureFrame();
ws.send(JSON.stringify({
type: 'frame',
frame_number: frameCount++,
frame_data: frame,
timestamp: Date.now() / 1000
}));
}, 1000 / FRAME_RATE);
```

### After (V2 - SDK)

```tsx
import { MoverisProvider, LivenessView } from '@moveris/react';

// That's all you need!
<MoverisProvider apiKey={API_KEY}>
<LivenessView
onResult={(result) => {
if (result.verdict === 'live') {
navigate('/success');
}
}}
/>
</MoverisProvider>
```

### Key Differences

| Feature | V1 (WebSocket) | V2 (SDK) |
|---------|----------------|----------|
| Connection | Manual WebSocket | Automatic |
| Frame Capture | Manual canvas | Built-in |
| Face Detection | None | Built-in (MediaPipe) |
| Quality Checks | None | Automatic |
| Progress Tracking | Manual | Built-in |
| Error Handling | Manual | Built-in |
| TypeScript | No | Full support |

---

## HTML5 Standalone Implementation

### Overview
Expand Down