# @paypay/jsbridge

> Jsbridge for communication between native app and webview

Latest version **2.0.0-pre.0** (published 2020-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @paypay/jsbridge
pnpm add @paypay/jsbridge
yarn add @paypay/jsbridge
bun add @paypay/jsbridge
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0-pre.0 |
| Published | 2020-07-20 |
| First published | 2020-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 635.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kun Cheng |
| Maintainers | lkay, paypay_owner |

## Links

- npm: https://www.npmjs.com/package/@paypay/jsbridge
- Repository: https://github.com/Pay-Baymax/paypay-jsbridge
- Homepage: https://github.com/Pay-Baymax/paypay-jsbridge#readme
- Issues: https://github.com/Pay-Baymax/paypay-jsbridge/issues
- npm.io page: https://npm.io/package/@paypay/jsbridge

## Dependencies (2)

- [@paypay/jsbridge-core](https://npm.io/package/@paypay/jsbridge-core.md) ^2.0.0-pre.0
- [@paypay/jsbridge-module-basic](https://npm.io/package/@paypay/jsbridge-module-basic.md) ^2.0.0-pre.0

## Recent versions

- 2.0.0-pre.0 (latest) — 2020-07-20
- 2.0.0-pre.3 (next) — 2021-01-25
- 2.0.0-pre.2 — 2020-10-27
- 2.0.0-pre.1 — 2020-09-08

## README

<p align="center">
  <h3 align="center"><code>@paypay/jsbridge</code></h3>

  <p align="center">
    Bundle containing all the methods that are used for 3rd party apps development.
  </p>
</p>

<!-- TABLE OF CONTENTS -->
## Table of Contents

* [About the Project](#about-the-project)
  * [Built With](#built-with)
* [Getting Started](#getting-started)
  * [Prerequisites](#prerequisites)
  * [Installation](#installation)
  * [Usage](#usage)
* [API](#api)
* [License](#license)


<!-- ABOUT THE PROJECT -->
## About The Project

This module contains ready to use JsBridge bundle, primary for 3rd party apps development.   

### Built With

* [Typescript](https://www.typescriptlang.org/)


<!-- GETTING STARTED -->
## Getting Started

This module contains a ready to use bundle, including all necessary modules.

### Prerequisites

The only requirement is to have NPM or Yarn installed in the system.

### Installation

To install package, simply use NPM:

```sh
npm install @paypay/jsbridge
```

Or Yarn

```sh
yarn add @paypay/jsbridge
```

### Usage

Importing the module will automatically expose all necessary objects and instances to global `window` object. 
To access available methods either imported instance or global `window` reference can be used.

All exposed methods take optional callback parameters that can be used to handle results instead of using `async/await`
syntax. 

```javascript
import jsBridge from '@paypay/jsbridge'

const result = await jsBridge.getSystemInfo()

// OR

jsBridge.getSystemInfo()
  .then((res) => {
    // Handle success
    console.log(res)
  })
  .catch((err) => {
    // Handle failure
    console.log(err)
  })
  .finally(() => {
    // HAndle complete
  })

// OR

jsBridge.getSystemInfo({
  success(res) {
    // Handle success
    console.log(res)
  },
  fail(err) {
    // Handle failure
    console.log(err)
  },
  complete() {
    // Handle complete
  }
})
```

This is equivalent to:

```javascript
import '@paypay/jsbridge'

const result = await window.PayPayJsBridge.getSystemInfo()
```     

<!-- API -->
## API

API documentation, auto generated by [Typedoc](https://typedoc.org/) are available in [`docs`](./docs) folder.

The bundle exposes all methods defined in embedded modules:

* [`@paypay/jsbridge-module-basic`](../../@paypay/jsbridge-module-basic)

Please refer to the modules documentation for more details for their APIs.


<!-- LICENSE -->
## License

Distributed under the MIT License. See [`LICENSE`](./LICENSE) for more information.

---
_Source: https://npm.io/package/@paypay/jsbridge · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
