saymoon / mixin-sdk-jsbridge

The JSBridge SDK base on Mixin Eco

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@foxone/mixin-sdk-jsbridge

NPM downloads npm version install size license

English | 简体中文

Introduction

The Js Bridge SDK base on Mixin Eco.

There is a bot which use the sdk.

You can search 7000103847 in Mixin Messenger or Reborn App to find it.

For more details, please read the Documentation

Install

NPM

npm install -S @foxone/mixin-sdk-jsbridge
# or
yarn add @foxone/mixin-sdk-jsbridge

src/index.ts

import Bridge from '@foxone/mixin-sdk-jsbridge';

const bridge = new Bridge();

bridge.getContext();

// ……

CDN

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Hello MXBridge</title>
  </head>
  <body>
    <button onclick="goLogin()">login</button>
  </body>
  <script src="https://unpkg.com/@foxone/mixin-sdk-jsbridge@latest/umd/mixin.bridge.min.js"></script>
  <script>
    function goLogin () {
      const { Bridge } = $MXBridge;
      const bridge = new Bridge({
        client_id: '86cf39ad-4e63-46c6-a6db-90cea8d05c1d'
      });
      bridge.login({
        phone: true,
        assets: true
      });
    }
  </script>
</html>

Dev

For debugging or maintenance, you can clone the whole git repository and then start the project.

git clone --depth 1 git@github.com:fox-one/mixin-sdk-jsbridge.git

cd mixin-sdk-jsbridge

npm i -g lerna yarn

yarn bootstrap

yarn dev

More Detials

About

The JSBridge SDK base on Mixin Eco

License:MIT License


Languages

Language:TypeScript 49.2%Language:JavaScript 35.5%Language:Vue 10.9%Language:Less 3.5%Language:HTML 0.8%