# appinsights-module

> This module provides integration with Microsoft's Application Insights for React Native applications. It enables you to easily track various events, user profiles, and campaign details within your React Native project.

Latest version **1.0.4** (published 2024-02-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install appinsights-module
pnpm add appinsights-module
yarn add appinsights-module
bun add appinsights-module
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2024-02-13 |
| First published | 2024-01-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 20.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | azzamubaidillah |

## Links

- npm: https://www.npmjs.com/package/appinsights-module
- npm.io page: https://npm.io/package/appinsights-module

## Dependencies (2)

- [@microsoft/applicationinsights-web](https://npm.io/package/@microsoft/applicationinsights-web.md) ^3.0.7
- [@microsoft/applicationinsights-react-native](https://npm.io/package/@microsoft/applicationinsights-react-native.md) ^4.0.2

## Recent versions

- 1.0.4 (latest) — 2024-02-13
- 1.0.3 — 2024-02-07
- 1.0.1 — 2024-01-23
- 1.0.0 — 2024-01-18

## README

# Application Insights Module for React Native

This module provides integration with Microsoft's Application Insights for React Native applications. It enables you to easily track various events, user profiles, and campaign details within your React Native project.

## Installation

To install the module, use the following npm command:

```bash
npm install appinsights-module
```

## Usage

#### Initialization

Before using any tracking functions, initialize the Application Insights module by calling initAppInsights().

```bash
import { initAppInsights } from 'appinsights-module';

initAppInsights();
```

#### Tracking Page Views

You can track page views using the trackPageView function.

```bash
import { trackPageView } from 'appinsights-module';

trackPageView('HomePage');
```

#### Tracking Device Model

Track device model and related information with the trackDeviceModel function.

```bash
import { trackDeviceModel } from 'appinsights-module';

trackDeviceModel('iPhone X', 'Apple', 'iPhone', '12345', 'iOS', '14.2', 'com.example.app', '1.0');

```

#### Tracking User Profile

Track user profiles with the trackUserProfile function.

```bash
import { trackUserProfile } from 'appinsights-module';

trackUserProfile( 
    'John Doe', 'john@example.com', '123456789', 'Jakarta', 'Central Jakarta', 'Karet Tengsin',
    'Tanah Abang', 'Male', '123 Main St', 'Bachelor\'s Degree', 'Non-religious', 'Reading, Hiking',
    'iOS Developer', 'Jakarta', '5000', 'REF123', '100'
);

```

#### Tracking Campaign Details

Track campaign details with the trackSliderDetail, trackBannerDetail, and trackBannerClose functions.

```bash

import { 
    trackSliderDetail,
    trackBannerDetail,
    trackBannerClose
} from 'appinsights-module';

// Track slider detail event
trackSliderDetail('CampaignTitle', 'Slider', '123', 'image.jpg', 'https://example.com', 'REF456');

// Track banner detail event
trackBannerDetail('CampaignTitle', 'Banner', '456', 'banner.jpg', 'https://example.com/banner', 'REF789');

// Track banner close event
trackBannerClose('CampaignTitle', 'Banner', '789', 'banner.jpg', 'https://example.com/banner', 'REF012');

```

#### Tracking Voucher Redemption

Track voucher redemption events with the trackVoucherRedeem function.

``` bash

import { trackVoucherRedeem } from 'appinsights-module';

trackVoucherRedeem('VOUCHER123');

```

---
_Source: https://npm.io/package/appinsights-module · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
