1. API Documentation
  2. Motion Capture WebSocket API documentation

WebSocket API authentication

Header: ‘Authorization’

WS-HMAC-SHA256 Credential=[AccessKey], Event=CONNECT, Signature=[timestamp(ms)]:[HMAC hex]

ex)

WS-HMAC-SHA256 Credential=AKIA5QKJTP5Z23CFYJWK, Event=CONNECT, Signature=1648167004270:76251c6323fbf6355f23816a4c2e12edfd10672517104763ab1b10f078277f86

HMAC(Signature)

const crypto = require('crypto');

const socketBodyHash = crypto.createHash('md5').update(socketApiId).digest('hex');
const socketTimestamp = Date.now().toString();
const socketHmac = crypto.createHmac('sha256', secretKey);
socketHmac.update(socketTimestamp);
socketHmac.update('CONNECT');
socketHmac.update(socketBodyHash);

const socketAuthHeader = `WS-HMAC-SHA256 Credential=${accessKey}, Event=CONNECT, Signature=${socketTimestamp}:${socketHmac.digest('hex')}`