NPM Package

Add the JavaScript Bridge to your Single-Page Application

Median JavaScript Bridge NPM Package

Simplify the integration of your Single-Page Applications (SPAs) with the Median JavaScript Bridge NPM Package. Designed to work across popular JavaScript frameworks such as React, Angular, Vue.js, and more, this framework-agnostic library simplifies the use of Median JavaScript Bridge methods in your web apps.

Follow the steps below to install the package and start using within your web app.

Explore the Package on NPM: https://www.npmjs.com/package/median-js-bridge

Implementation Guide

App Configuration

When utilizing the Median JavaScript Bridge NPM package in your web application, remember to enable the corresponding option in the App Studio (Website Override > JavaScript Frameworks and NPM). This step prevents conflicts with the native app's embedded JavaScript Bridge Library and activates required listener support. Omitting the package while enabling the option may result in unresponsive JavaScript Bridge functions and callbacks.

Web App Installation Instructions

Using a Package Manager

Install the package via npm or yarn for seamless integration into your project.

With npm:

npm install median-js-bridge --save

With yarn

yarn add median-js-bridge

Using a Script Tag

If you prefer to add the library directly to your web page, include the following script tag in your HTML:

<script type="text/javascript" src="https://unpkg.com/median-js-bridge@latest/dist/median.min.js"></script>

Next Steps

After a successful installation of the package you can explore dedicated use cases and examples to implement callbacks, set up event listeners and implement an optimized Navigation for your SPA.

Example Commands

Learn how to use the Median platform's features, including integration steps and key functionalities and review implementation examples for basic features in the app lifecycle.

šŸ“– Learn more: Basic Usage

Using Listeners

Learn how to use the Median NPM package with event listeners. Learn to register and manage listeners for various app events such as deep links and push notifications to enable efficient event handling in your app.

šŸ“– Learn more: Using Listeners

SPA Navigation

Learn how to manage navigation within a Single Page Application (SPA) using Median's NPM package.

šŸ“– Learn more: SPA Navigation