1.0.0 • Published 3 years ago
@sidemash/sdk v1.0.0
sdk-js
Sdk for live video streaming with Sidemash Cloud in Javascript Typescript
Installation
yarn add sidemash-sdk
This repo has its own type definition so you don't need to install @types
Configuration
First, log in your account and create an AuthAccess
object to query Sidemash Cloud with API. On creation, you will have a token and a privateKey : Use them to initialize a Sidemash client.
import {SidemashClient, Auth} from "sidemash-sdk"
const sdm = SidemashClient(Auth({ token : "1234", privateKey: "secret" }))
Usage
Nomenclature
The is pretty staright forward, if You have a resource that you want to Get List Update Patch or Delete, the you should do sdm.{resourceTypeCamelCase}.{operation}({operationArgs})
.
Get resources
sdm.streamSquare.get({ id: "1234" })
List resources
sdm.streamSquare.list({ where: "createdTime:in:[Yesterday.14h, Yesterday.15h[" })
sdm.streamSquare.list({ orderBy: "createdTime:ASC,status:DESC" })
Create resources
import {StreamSquare} from "sidemash-sdk"
sdm.streamSquare.create({ size: StreamSquare.Size.S, isElastic: false })
Update resources
sdm.streamSquare.update({ id : "1234", newSize: StreamSquare.Size.M })
Delete resources
sdm.streamSquare.delete({id: "1234" })
1.0.0
3 years ago