# @react-native-embrace/webview-tracker

> Allows to track events on WebViews components

Latest version **0.2.12** (published 2023-05-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install @react-native-embrace/webview-tracker
pnpm add @react-native-embrace/webview-tracker
yarn add @react-native-embrace/webview-tracker
bun add @react-native-embrace/webview-tracker
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.12 |
| Published | 2023-05-04 |
| First published | 2023-05-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Embrace.io |
| Maintainers | fnewberg, themutsi |

## Links

- npm: https://www.npmjs.com/package/@react-native-embrace/webview-tracker
- Repository: https://github.com/embrace-io/react-native-embrace
- Homepage: https://embrace.io/
- Issues: https://github.com/embrace-io/react-native-embrace/issues
- npm.io page: https://npm.io/package/@react-native-embrace/webview-tracker

## Recent versions

- 0.2.12 (latest) — 2023-05-04

## README

# React Native Embrace - WebView Tracker

> ## Core Module Required
>
> This module requires [React Native Embrace SDK](https://www.npmjs.com/package/react-native-embrace).

# Add WebView Tracker

## Adding Context to Sessions

Embrace can collect basic session data and crashes as you've already seen in the [Crash Reporting](https://embrace.io/docs/react-native/integration/crash-reporting) and [Session Reporting](https://embrace.io/docs/react-native/integration/session-reporting) sections.
Embrace can also collect the data from your web page inside a Webview component
Here's how you add the WebView tracker to the session.

## Adding the component

Embrace has a separate module for tracking WebView, to use it you will need to add the WebView Tracker

### Install the component

```sh
yarn add @react-native-embrace/webview-tracker
```

```sh
npm install @react-native-embrace/webview-tracker
```

### Adding the method to your code

Add the logEmbraceWebView to your WebView component

```javascript
// Import the Embrace log method
import { logEmbraceWebView } from "@react-native-embrace/webview-tracker";
import { WebView } from "react-native-webview";

const App = () => {
  const handleOnMessage = (message) => {
    logEmbraceWebView("MyCheckout", message);
  };
  return (
    <WebView
      useWebKit
      onMessage={handleOnMessage}
      source={{ uri: "URL TO TRACK" }}
    />
  );
};
```

---
_Source: https://npm.io/package/@react-native-embrace/webview-tracker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
