bblurock / beachball

:soccer: Migme JS SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Migme JS SDK

Migme JavaScript SDK. Throws data to the Migme API.

Gitter Codeship Travis CI Codecov Dependency Status JavaScript Standard Style npm npm GitHub Releases

Beachball Migbot

Installation

NPM

npm install migme

Usage

Loading

// ES6
import Migme from 'migme'

// CommonJS
var Migme = require('migme')

// AMD
define(['migme'], function (Migme) {
  // ...
})

Loading in browser

<script>
  window.migmeAsyncInit = function() {
    MIGME.init({
      client_id: 'your client id',
      redirect_uri: 'URI to redirect to after login'
    });
  };

  (function(d, s, id){
     var js, mjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "https://npmcdn.com/migme/lib/sdk.js";
     mjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'migme-jssdk'));
</script>

Initialization

Migme.init({
  // options
  client_id: 'XXXXXXXXXXXXX',
  access_token: '' // If you already have one
})

Development

npm install # Install dependencies
npm test    # Test only
npm run build  # Build only
ezoic increase your site revenue

About

:soccer: Migme JS SDK


Languages

Language:JavaScript 100.0%