Add stream
client.streams.add(stringnamespace, StreamAddParams { id, stream_url } body, RequestOptionsoptions?): StreamAddResponse { requestId, status }
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
Returns
Add stream
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);{
"requestId": "req_01h2m7qdmdjckc30e1mnq6xqfd",
"status": "accepted"
}Returns Examples
{
"requestId": "req_01h2m7qdmdjckc30e1mnq6xqfd",
"status": "accepted"
}