traverse-sdk
v0.0.4
Published
SDK connection to interface
Readme
Traverse SDK Bridge
A lightweight SDK to bridge communication between WebView (JavaScript) and native mobile apps (Android/iOS/React Native) for Mini App platforms.
📌 What is Traverse SDK?
Traverse SDK is a JavaScript-based bridge that allows a web application (usually embedded in a WebView) to communicate with native mobile applications. This SDK helps web developers:
- Send requests to native apps
- Receive data or responses back from native
- Register custom event handlers from the native side
- Provide a consistent bridge interface across Android, iOS and React Native
📦 Installation
npm install traverse-sdk🚀 Basic Usage
import {Traverse} from 'traverse-sdk';
// callHandler
const something = await Traverse.bridge("doSomething"); //JS -> Native
console.log(something.getSomething())
// registerHandler
Traverse.bridge('myListener', (data,cb) => {
console.log('Getting data from native', data);
const responseData = { "Javascript Says": "Here get it!" };
console.log("JS responding to native with", responseData);
cb(responseData);
}); //Native -> JS