The Bambuser Node library provides means for communicating with the Bambuser REST API.
Usage
The library needs to be configured with an API key for your Bambuser account which can be found on the dashboard. Pass the key into the constructor:
const BambuserAPI = ; const bambuser = 'your-key-goes-here';
Optionally, pass more options:
const bambuser = apiKey: 'your-key-goes-here' daId: 'your-signing-key' daSecret: 'your-signing-secret';
Key | Type | Description |
---|---|---|
apiKey | string | Your Bambuser API key |
daId | string | (optional) The id part of your signing key |
daSecret | string | (optional) The secret part of your signing key |
You can find your API key and signing key on dashboard.bambuser.com/developer.
Fetching broadcast or image metadata
Get the last few items:
const broadcasts = await bambuserbroadcasts; const images = await bambuserimages;
Get items with options:
You can find all available options in the REST API documentation.
const broadcasts = await bambuserbroadcasts; // (same for bambuser.images)
List items with pagination:
const pager = await bambuserbroadcasts;let broadcasts = pageResults;while pageResults = await pagernext broadcasts = broadcasts; // (same for bambuser.images)
Get an image or broadcast by their id:
const broadcast = await bambuserbroadcasts; // (same for bambuser.images)
Deleting broadcasts or images
Get an image or broadcast by their id:
await bambuserbroadcasts; // (same for bambuser.images)
Get a link to a broadcast player
To use this method you must configure the API client with your signing keys.
const broadcasts = await bambuserbroadcasts;const playerUrl = bambuserbroadcasts;
Get a Download link to a broadcast
To use this method you must configure the API client with your signing keys.
const broadcastDownloadLink = await bambuserbroadcasts;
Create a clip from a broadcast
let start = 5;let end = 145;const newBroadcastId = await bambuserbroadcasts; // Wait for the new broadcast (clip) to become readylet broadcast;const waitForNewBroadcast = async { try broadcast = await bambuserbroadcasts; catch err if err instanceof BambuserAPIerrorsResourceNotFound // Still not ready, wait a short time before checking again await ; return await ; throw err; };await ;console;
Tag a broadcast
await bambuserbroadcasts;// {text: 'baz', id: 665928}
Tags can be created with an optional start and (also optional) end position, specified as no. seconds into the broadcasts.
Do this by supplying positionStart
/positionEnd
in an option
object as the third argument:
await bambuserbroadcasts;
Removing tags from a broadcast
Remove a single tag by its id:
await bambuserbroadcasts;
Remove all tags from a broadcast:
await bambuserbroadcasts;