Javascript bridge

Until now Terra sdk is written in native android/iOS only, there are no support for web Javascript yet.

However as a web app runs inside a WebView, or a react-native app inside a native host app, you can still leverage Terra native API with just some extra setup.

Setup for native side#

To enable Javascript bridge support for web/react-native side to use, please install the native bridge parts of Terra's modules. You can choose to install web bridge, react-native bridge or both:

Setup For web app#

Install bridge module:

yarn add @terra-js/web-bridge

Inside your web app, import it in every files that use Terra api:

import '@terra-js/web-bridge';

Setup for react-native app#

Install bridge module:

yarn add @terra-js/react-native-bridge

Inside your react-native app, import it in every files that use Terra api:

import '@terra-js/react-native-bridge';

Javascript API#

You can find guideline for Javascript API in Javascript tab of code sample, like this one

Please note that not every API is ready for Javascript yet, we are still working on it!