Installation
You can use the client library to integrate your app with the Senza platform. There are two ways to use the library:
- Download an NPM package
- Link to the library using a script tag
NPM Package
The senza-sdk package can be installed using NPM with this command:
npm install senza-sdk
If your app has a package.json
file, you can add it as a dependency like this:
{
"name": "myapp",
"version": "1.0.0",
"dependencies": {
"senza-sdk": "^4.2.54",
}
}
You can then import senza from the module in your app:
import * as senza from "senza-sdk";
You'll need to use a tool like webpack to bundle the assets into your app.
Script Tag
The client library can be imported using a script tag like this:
<head>
<script src="https://senza-sdk.streaming.synamedia.com/latest/bundle.js" defer></script>
</head>
This method is compatible with older web apps, and doesn't require using webpack.
Using the library
With either method, you can use the senza
object in your app as follows:
window.addEventListener("load", async () => {
try {
await senza.init();
senza.uiReady();
} catch (e) {
console.error(e);
}
});
Updated about 1 month ago
What’s Next