Skip to content

inplayer-org/inplayer.js

Repository files navigation

InPlayer's JS API client wrapper

npm version CI Netlify Status

inplayer.com

SDK Documentation can be found:

Examples

Installation

Install the package from npm and import it in your project.

npm install --save @inplayer-org/inplayer.js

Alternatively you can include the script like so:

Latest v2 version

<script src="https://unpkg.com/@inplayer-org/inplayer.js@v2/dist/inplayer.umd.js"></script>

Latest v3 version

<script src="https://unpkg.com/@inplayer-org/inplayer.js@v3/dist/inplayer.min.js"></script>

Sign in using grant type: password

InPlayer.Account.signIn({
    email: '[email protected]',
    password: '12345678',
    clientId: 'b0899d7f-66da-40fc-8eeb-36cad735589c',
    referrer: 'http://localhost:3000/'
}).then(data => console.log(data));

Sign in using grant type: refresh token

InPlayer.Account.signIn({
    clientId: 'b0899d7f-66da-40fc-8eeb-36cad735589c',
    refreshToken: '528b1b80-ddd1hj-4abc-gha3j-111111',
    referrer: 'http://localhost:3000/'
}).then(data => console.log(data));

Sign in using grant type: client secret

InPlayer.Account.signIn({
    clientId: 'b0899d7f-66da-40fc-8eeb-36cad735589c',
    clientSecret: '528b1b80-ddd1hj-4abc-gha3j-111111',
    referrer: 'http://localhost:3000/'
}).then(data => console.log(data));

Contributing

We love community contributions, so here's a quick guide if you want to help out:

  1. Fork the repository
  2. Write your changes
  3. Make sure the tests pass
  4. Update the docs
  5. Commit your changes
  6. Send us a PR