This SDK provides a TypeScript interface for seamlessly interacting with the Oven Media Engine (OME) REST API.
Use NPM to install the SDK:
npm install ovenmediaengine-ts-sdk
- Initialization
Import the SDK and initialize it with your OME server's base URL.
import OvenMediaEngineSDK from 'ovenmediaengine-ts-sdk';
const omeSDK = new OvenMediaEngineSDK({ baseURL: 'http://your-ome-server-address:port' });
- Authentication
omeSDK.setAuthorization('your_access_token');
- Version
omeSDK.setVersion('v1');
- Making API Calls
Use the provided methods from the SDK to make calls to the API.
// Example: Fetch the list of Virtual Host
omeSDK.getVirtualHosts().then(response => {
console.log(response.data);
}).catch(error => {
console.error("Error fetching Virtual Host:", error);
});
getVirtualHosts
Get Virtual Host ListcreateVirtualHost
Create Virtual HostgetVirtualHost
Get Virtual Host InformationdeleteVirtualHost
Delete Virtual HostreloadAllCertificates
Reload All CertificatesreloadAllCertificate
Reload CertificategetApps
Get Application ListcreateApp
Create ApplicationgetApp
Get Application InformationpatchApp
Patch Application InformationdeleteApp
Delete ApplicationgetOutputProfiles
Get Output Profile ListcreateOutputProfile
Create Output ProfilegetOutputProfile
Get Output Profile InformationdeleteOutputProfile
Delete Output ProfilestartRecording
Start RecordingstopRecording
Stop RecordinggetRecordingState
Get Recording StatestartPushPublishing
Start Push PublishingstopPushPublishing
Stop Push PublishinggetPushPublishingState
Get Push Publishing StategetStreams
Get Stream ListcreateStream
Create Stream (Pull)getStream
Get Stream InfodeleteStream
Delete StreamsendEvent
Send EventstartDump
Start DumpstopDump
Stop DumpgetVirtualHostStatistics
Get Statistics of Virtual HostgetApplicationStatistics
Get Statistics of ApplicationgetStreamStatistics
Get Statistics of Stream
[Add further methods here as they get added to the SDK.]
To test the SDK during development, use:
npm run dev
This will run the sample script located in the samples
folder.
Contributions are welcome! Please create an issue or pull request for any suggestions or improvements.