1.0.1 • Published 6 months ago

@catch-health/mobile-widget v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

Mobile Widget

Requirements

You need to have react, react-native and react-native-webview (version 11) installed in your project.

Installation

npm install @catch-health/mobile-widget

Usage

import { CatchWidget } from '@catch-health/mobile-widget';

// ...

<CatchWidget userId="<userId>" loginToken="<loginToken>" widgetId="<widgetId>" />

Properties

widgetId (required)

This is the ID provided by Catch Health, it represents the widget to be displayed.

userId and loginToken

These properties are used to start the widget with a logged in user.

route

This property is used to pass an extended route to the internal widget.

environment (default: 'production')

The environment the widget is going to run on. The options are: 'production' and 'staging'.

onClose

This event is called when the user hits the "Exit" button from within the widget. It can be used to customize the closing behavior on your app.

onLoadStart

This event is called when the widget starts loading.

onLoadEnd

This event is called when the widget finishes loading.

noCache (default: false)

This property is used to force clearing the cache inside the WebView, where Catch's widget runs.

Cleaning cache

The login information is stored in the widget. It can be cleared by calling the cleanCache function:

import { cleanCache } from '@catch-health/mobile-widget'; 

// ...
const handleLogout = () => {
  cleanCache();
};
1.0.1

6 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

9 months ago

0.2.5

9 months ago

0.2.4

9 months ago

0.2.3

9 months ago

0.2.2

9 months ago

0.2.1

10 months ago

0.2.0

10 months ago