# Streams ## Add `client.streams.add(stringnamespace, StreamAddParamsbody, RequestOptionsoptions?): StreamAddResponse` **post** `/v1/streams/{namespace}` Monitor the livestream at the given stream URL. This method returns immediately. ### Parameters - `namespace: string` The namespace to ingest stream data into - `body: StreamAddParams` - `id: string` - `stream_url: string` ### Returns - `StreamAddResponse` Stream ingestion request accepted for asynchronous processing. - `requestId: string` - `status: "accepted"` - `"accepted"` ### Example ```typescript import Safetykit from 'safetykit'; const client = new Safetykit({ apiKey: process.env['SAFETYKIT_API_KEY'], // This is the default and can be omitted }); const response = await client.streams.add('namespace', { id: 'YOUR_STREAM_ID', stream_url: 'https://cdn.example.com/20948D23.m3u8', }); console.log(response.requestId); ``` ## Add Parts `client.streams.addParts(stringnamespace, StreamAddPartsParamsbody, RequestOptionsoptions?): StreamAddPartsResponse` **post** `/v1/streams/{namespace}/parts` Append a list of parts to a stream by the stream identifier. The stream does not need to be created beforehand. This method returns immediately; parts are processed asynchronously. ### Parameters - `namespace: string` The namespace to ingest stream data into - `body: StreamAddPartsParams` - `id: string` - `data: Array` - `AudioURL` - `timestamp: string` - `type: "audio_url"` - `"audio_url"` - `url: string` - `FrameImageURL` - `timestamp: string` - `type: "frame_image_url"` - `"frame_image_url"` - `url: string` - `ChatMessage` - `sender_display_name: string` - `sender_id: string` - `text: string` - `timestamp: string` - `type: "chat_message"` - `"chat_message"` - `Transcript` - `text: string` - `timestamp: string` - `type: "transcript"` - `"transcript"` - `speaker?: string | null` ### Returns - `StreamAddPartsResponse` Stream ingestion request accepted for asynchronous processing. - `requestId: string` - `status: "accepted"` - `"accepted"` ### Example ```typescript import Safetykit from 'safetykit'; const client = new Safetykit({ apiKey: process.env['SAFETYKIT_API_KEY'], // This is the default and can be omitted }); const response = await client.streams.addParts('namespace', { id: 'YOUR_STREAM_ID', data: [ { type: 'audio_url', timestamp: '2026-03-10T18:54:20+00:00', url: 'https://example.com/234039.mp3', }, ], }); console.log(response.requestId); ```