Skip to content
This repository has been archived by the owner on Feb 16, 2019. It is now read-only.

Latest commit

 

History

History
30 lines (19 loc) · 732 Bytes

using-in-browser.md

File metadata and controls

30 lines (19 loc) · 732 Bytes

Using in browser

To use the client library in a browser you can just include the minified or non-minified script from the browser/ directory of this project.

To use with a browserify bundle, you can require the index-browser.js file.

For example:

var browserify = require('browserify')

var b = browserify()

b.require('./index-browser.js', { expose: 'stremio-addons' })

b.bundle().pipe(require('fs').createWriteStream('stremio-addons.js'))

Then add it to your browser app:

<script src='stremio-addons.js'></script>

And initialize as normal:

var Stremio = require('stremio-addons')
var client = new Stremio.Client()