@hackler/react-native-webview-plugin
v1.2.0
Published
Hackle WebView bridge for React Native
Downloads
442
Readme
@hackler/react-native-webview-plugin
Hackle WebView bridge plugin for React Native.
Features
- Seamless integration with
react-native-webview - Automatic Hackle bridge injection into WebView instances
- Optional automatic tracking for screen views, engagement, and route changes
Requirements
react-native-webview>= 13.13.0@hackler/react-native-sdk>= 3.30.0 < 4.0.0
Installation
npm install @hackler/react-native-webview-plugin
# or, using yarn:
# yarn add @hackler/react-native-webview-pluginQuick Start
Basic Usage
import { WebView } from 'react-native-webview';
import { createHackleWebViewConfig } from '@hackler/react-native-webview-plugin';
function MyWebView() {
const config = createHackleWebViewConfig();
return (
<WebView
source={{ uri: 'https://your-website.com' }}
nativeConfig={config}
/>
);
}With Configuration Options
import { WebView } from 'react-native-webview';
import { createHackleWebViewConfig } from '@hackler/react-native-webview-plugin';
function MyWebView() {
const config = createHackleWebViewConfig({
automaticScreenTracking: true,
automaticEngagementTracking: true,
automaticRouteTracking: true,
});
return (
<WebView
source={{ uri: 'https://your-website.com' }}
nativeConfig={config}
/>
);
}Configuration Options
| Option | Type | Default | Description |
| ----------------------------- | --------- | ------- | ------------------------------------------------------ |
| automaticScreenTracking | boolean | false | Automatically collect $page_view events |
| automaticEngagementTracking | boolean | false | Automatically collect engagement events |
| automaticRouteTracking | boolean | true | Automatically collect page route information |
