diff --git a/README.md b/README.md index fe26a40..e27d48e 100644 --- a/README.md +++ b/README.md @@ -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! - - { - if (result.verdict === 'live') { - navigate('/success'); - } - }} - /> - -``` - -### 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