@sofya-sdk/types
v1.0.0
Published
TypeScript types for Sofya SDK
Maintainers
Readme
@sofya-sdk/types
TypeScript type definitions for Sofya SDK.
Installation
pnpm add @sofya-sdk/typesUsage
import type {
EventRoomsConfig,
ServerEventMessage,
ClientEventMessage,
CanalConfig,
CreateCanalResponse,
ConnectionState,
} from '@sofya-sdk/types';
const config: EventRoomsConfig = {
url: 'wss://messaging.sofya.app/ws',
roomId: 'ROOM123',
role: 'desktop',
};Type Exports
EventRooms Types
ReservedType- Reserved message type namesClientRole- Client role ('desktop' | 'mic' | 'unknown')ClientInfo- Client informationConnectionState- Connection stateEventRoomsConfig- Client configuration
Message Types
Client → Server:
JoinMessageLeaveMessagePingMessageClientEventMessageClientMessage(union)
Server → Client:
HelloMessageJoinedMessagePongMessagePresenceMessageServerEventMessageErrorMessageServerMessage(union)
Backend API Types
CreateCanalResponse- Response from creating a canal (includes messaging endpoint, STT endpoint, and contract)CanalConfig- Canal configuration (includes messaging endpoint, STT endpoint, and contract)CanalContract- Normalized backend contract (service, client, STT, QR code, EventRooms)EventRoomConfig- EventRooms payload extracted from the contractQrCodeConfig/QrCodeLinks- QR code metadata and asset linksSttConfig/SttProvider- STT provider configurationBackendApiConfig- API client configurationApiError- API error response
License
ISC
