js-miniapp-bridge
v0.0.5
Published
JS bridge for iOS/Android platforms which uses Ionic Portals (https://ionic.io/docs/portals)
Downloads
7
Readme
JS MiniApps SDK
JS bridge for iOS/Android platforms which uses Ionic Portals (https://ionic.io/docs/portals)
Usage
- Install package into project:
yarn add js-miniapp-bridge
ornpm i js-miniapp-bridge
- Import module in Web project, example:
import { SendMessage } from "js-miniapp-bridge"
(https://github.com/mhushang/js-miniapp-sdk-examples/tree/main/web) - Available methods:
SendMessage, SubscribeToMessage, UnsubscribeFromMessage, GetInitialContext
Examples
- Web: (https://github.com/mhushang/js-miniapp-sdk-examples/tree/main/web)
- React Native (https://github.com/mhushang/js-miniapp-sdk-examples/tree/main/reactNative)
https://www.loom.com/share/12fa9842a713462eb3a9edade4985224
Available scripts of the library
The project contains the following scripts:
dev
- starts dev serverbuild
- generates the following bundles: CommonJS (.cjs
) ESM (.mjs
) and IIFE (.iife.js
). The name of bundle is automatically taked frompackage.json
name propertytest
- starts jest and runs all teststest:coverage
- starts jest and run all tests with code coverage reportlint:scripts
- lint.ts
files with eslintlint:styles
- lint.css
and.scss
files with stylelintformat:scripts
- format.ts
,.html
and.json
files with prettierformat:styles
- format.cs
and.scss
files with stylelintformat
- format all with prettier and stylelintprepare
- script for setting up husky pre-commit hook