Installation - Storm JavaScript Library

Storm JavaScript Library can be easily installed using popular package managers like npm and yarn. You can also attach js file from our CDN. Below you'll find more detailed instructions.

Storm CDN

Feel free to pick our Storm Library (in IIFE format) from our CDN:

                        
<script src="https://cdn-scripts.stormstreaming.com/stormlibrary/4-latest.min.js"></script>
                            

Optionally you can link to the latest major.minor, for example 4.0-latest.min.js, or pick specific release: 4.0.0.min.js

To embed the library on your website you can use our CDN hosted file. It's based on IIFE and it's compatible with all modern browsers! Latest version can be found on our github page: https://github.com/StormStreaming/stormlibrary-js/releases.

Installation via Package Managers

  1. NPM: Before using NPM, please install Node.js.

    To integrate Storm Library into your project using NPM, execute the following command:

                                    
    npm install @stormstreaming/stormlibrary
                                
  2. Yarn: Yarn must be installed before use, which you can do via NPM.

    To incorporate Storm Library into your project using Yarn, execute the following command:

                                    
    yarn add @stormstreaming/stormlibrary
                                

Manual Installation

You can manually grab index.js from /dist/iife folder on our Git-Hub page. You will find the latest release here: https://github.com/StormStreaming/stormlibrary-js/releases.

Embedding the Library

Storm Library comes in IIFE, ESM, AMD, UMD and CJS formats. If you are unfamiliar with these, please grab IIFE version, as it's easiest to embed in a modern browser. All packages are located in /dist folder under their respective names.

Initiating the Library

Once the library is properly linked to your page, an instance can be finally created. Please keep in mind that you can create and manage multiple instances of Storm Library at a time. Each instance requires a valid configuration object in order to work properly. Initialization will look different depending on picked JavaScript format.

                        
const streamConfig = {
    stream: {
        serverList: [{
            host: "localhost",
            application: "live",
            port: 80,
            ssl: false
        }],
        streamKey: "test"
    },
    settings: {
        autoStart: true,
        video: {
            containerID: "videoContainer",
            width: "100%",
            aspectRatio: "16:9"
        },
    },
};
                    

Initialization will look different depending on picked JavaScript format.

  1. IIFE (Immediately invoked function expression):
                                    
    const storm = stormLibrary(streamConfig);
                                
  2. ESM (ECMAScript Modules):
                                    
    import {StormLibrary} from "../../dist/esm/index.js";
    const storm = new StormLibrary(streamConfig);
                                
  3. UMD (Universal Module Definition):
                                    
    const storm = stormLibrary.create(streamConfig);
                                
  4. AMD (Asynchronous Module Definition):
                                    
    requirejs(['../../dist/amd/index'], function (storm) {
        const stormInstance = new storm.create(streamConfig);
    });
                                
Next Step

For the next step please check our Storm JavaScript Library - Stream & Server guide where you’ll learn how to connect library with Storm Streaming Cloud or Server instance.

Support Needed?

Create a free ticket and our support team will provide you necessary assistance.