Installation - Storm JavaScript Library

Storm JavaScript Library can be easily installed using popular package managers like npm and yarn. Below you'll find more detailed instructions.

Install via package managers

  1. Node

    To include Storm Library in Node, first install NPM

                                    
    npm install storm-library
                                
  2. Yarn
                                    
    yarn install storm-library
                                

Embedding the library

Adding the Storm JavaScript Library is a straightforward task. Please keep in mind that you must locate your JavaScript file on an accessible path.

                            
<script src="https://your-domain.com/folder-name/storm-library-x.y.z.min.js"></script>
                        
Don't forget to replace x.y.z form the sample with valid major, minor, patch version. You can grab the latest version of the library here.

Initiating the library

Once the library is properly linked to your page, a library instance can be created. Please keep in mind that you can create and manage multiple instances of StormLibrary at a time. Each instance requires a valid configuration object in order to work properly.

                        
const storm = new StormLibrary(config)
                        

Accessing library (debugging)

All instances are automatically assigned to an array called “stormPlayerCollection”. If you wish to access one of the instances easily, you can use this way to call it:

                        
console.log(stormPlayerCollection);
                    

If you know the id of an instance, we can also access it via:

                        
stormPlayerCollection[playerID]