WebSocket API
Overview
Connecting
JavaScript/TypeScript
const ws = new WebSocket('wss://api.oura402.dev/data');
ws.onopen = () => {
console.log('Connected to Oura402 WebSocket');
// Subscribe to payments
ws.send(JSON.stringify({
method: 'subscribe',
keys: ['payments']
}));
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Received:', data);
};
ws.onerror = (error) => {
console.error('WebSocket error:', error);
};
ws.onclose = (event) => {
console.log('Connection closed:', event.code, event.reason);
};Python
Authentication
Subscription Methods
Subscribe to Channels
Subscribe to Specific Wallet
Unsubscribe
Event Types
Payment Event
Verification Event
Settlement Event
Error Event
Advanced Usage
Reconnection Logic
React Hook Example
Best Practices
Heartbeat/Ping-Pong
Error Codes
Code
Description
Next Steps
Last updated
