# appscoper

> plugin for appscoper to generate sdk and register events

Latest version **1.3.1** (published 2023-10-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install appscoper
pnpm add appscoper
yarn add appscoper
bun add appscoper
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2023-10-18 |
| First published | 2023-10-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 13.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | appscoper |

## Links

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

## Dependencies (2)

- [device-uuid](https://npm.io/package/device-uuid.md) ^1.0.4
- [react-native](https://npm.io/package/react-native.md) ^0.72.6

## Recent versions

- 1.3.1 (latest) — 2023-10-18
- 1.2.1 — 2023-10-17
- 1.2.0 — 2023-10-17
- 1.1.1 — 2023-10-16
- 1.1.0 — 2023-10-15
- 1.0.2 — 2023-10-15
- 1.0.1 — 2023-10-15
- 1.0.0 — 2023-10-15

## README

# Introduction

appscoper is a plugin designed to work with [`AppScoper`](https://me.appscoper.com) a platform that enables easy event tracking and analysis for your application. This plugin simplifies the process of AppScoper's main functionality by providing a sendEvent function that triggers your desired events.

# Installation

To install appscoper, run the following command in your terminal:

```sh
npm install appscoper
```

# Usage

Step 1: Create account
creating account at [`AppScoper`](https://me.appscoper.com)

Step 2: get the DEV_KEY

Before your developer can install and integrate the SDK, you must retrieve the DEV_KEY
AppScoper uses the DEV_KEY key to uniquely identify your account. The DEV_KEY is mandatory because it allows the SDK to securely send and retrieve data that belongs to your account.
In [`AppScoper`](https://me.appscoper.com) go to app settings and copy your DEV_KEY

Step 3: Import setAppKey, sendEvent function

```js
import { sendEvent, setAppKey } from "./node_modules/appscoper/src/index.js";
```

Step 4: Initialize SDK

-Call setAppKey with the DEV_KEY you copied at step2 as a parameter

```js
setAppKey("<YOUR_DEV_KEY>");
```

Step 5: Send event to AppsScopper for processing

```js
sendEvent(
  "<YOUR_APP_NAME>",
  "<USER_IDENTIFIER>",
  "<APP_SCREEN>",
  "<EVENT_NAME>",
  "<AMOUNT>",
  "<CURRENCY>",
  "<PRODUCT_SLUG>",
  "<PRODUCT_COUNT>",
  "<ARRAY_OF_ORDER_IDS>"
);
```

In the example above, the sendEvent function is used to send an event to AppScoper. You need to provide the following parameters:

- `<YOUR_APP_NAME>`: (string) The name or identifier of your application.
- `<USER_IDENTIFIER>`: (string) A unique identifier for the user triggering the event.
- `<APP_SCREEN>`: (string) The name or identifier of the screen or page where the event occurred.
- `<EVENT_NAME>`: (string) The name of the event being tracked (e.g., "PURCHASE" or "SEARCH").[Predefined Events](#predefined-events) - Click here to check all the predefined events.
- `<AMOUNT>`: (number) The amount associated with the event (e.g., purchase amount).
- `<CURRENCY>`:(string) The currency in which the amount is expressed (e.g., "USD" or "EUR").
- `<PRODUCT_SLUG>`: (string) The unique identifier or name of the product associated with the event.
- `<PRODUCT_COUNT>`: (number) The quantity or count of products involved in the event (e.g., items in a cart).
- `<ARRAY_OF_ORDER_IDS>`:(array of strings) An array of order IDs related to the event (e.g., for purchases).
  Make sure to replace the example values with your actual data.

  <a name="predefined-events"></a>

## Predefined Events

The `sendEvent` function in the `appscoper` plugin allows you to track various events in your application. Here are the allowed event names that you can use:

| Event Name           | Description                                                                                                                                                                        |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UNKNOWN_EVENT        |                                                                                                                                                                                    |
| PURCHASE             | This event signifies that a user has made a purchase within your application. You can use it to track transactions and measure the revenue generated from purchases.               |
| APP_INSTALL          | The APP_INSTALL event is triggered when a user installs your application. It helps you monitor user acquisition and can be valuable for marketing analysis.                        |
| SAVE                 | SAVE events should be recorded when a user saves content or data within your application. This can help you understand user engagement and content management patterns.            |
| START_CHECKOUT       | This event indicates the beginning of a checkout process. You can use it to monitor the user journey towards making a purchase or taking a desired action.                         |
| ADD_CART             | ADD_CART events are logged when a user adds items to their shopping cart or basket. This allows you to track products of interest and potential purchases.                         |
| VIEW_CONTENT         | Use VIEW_CONTENT events to record when a user views specific content, such as articles, images, or videos, within your application.                                                |
| ADD_BILLING          | ADD_BILLING events can be used to track the addition of billing information, which is crucial for transactions and subscription-based services.                                    |
| SIGN_UP              | This event is triggered when a user signs up or creates an account in your application. It helps monitor user registrations and conversions.                                       |
| SEARCH               | SEARCH events are logged when a user performs a search operation within your application. These events help track user information retrieval and content discovery.                |
| LEVEL_COMPLETE       | LEVEL_COMPLETE events can be used in gaming applications to indicate when a user successfully completes a level or stage.                                                          |
| APP_OPEN             | This event is triggered each time a user opens your application. It provides insights into user engagement and how often the app is used.                                          |
| PAGE_VIEW            | PAGE_VIEW events are recorded when a user navigates to and views a specific page or screen within your application.                                                                |
| SUBSCRIBE            | Use SUBSCRIBE events to monitor when users subscribe to a service, newsletter, or other recurring content.                                                                         |
| AD_CLICK             | This event is triggered when a user clicks on an advertisement within your application. It helps evaluate the effectiveness of ad campaigns.                                       |
| AD_VIEW              | AD_VIEW events are recorded when a user views an advertisement, even if they don't click on it. This data can be used for ad performance analysis.                                 |
| COMPLETE_TUTORIAL    | In gaming or tutorial-based applications, this event is logged when a user successfully completes a tutorial or onboarding process.                                                |
| INVITE               | INVITE events can be used to track when users send invitations or referrals to others, promoting your application through social connections.                                      |
| LOGIN                | This event is triggered when a user logs into their account. It helps monitor user engagement and login patterns.                                                                  |
| SHARE                | SHARE events are recorded when a user shares content from your application on social media or other platforms.                                                                     |
| RESERVE              | RESERVE events can be used in reservation or booking applications to track when a user reserves a spot or service.                                                                 |
| ACHIEVEMENT_UNLOCKED | In gaming applications, this event is logged when a user unlocks an achievement or earns a badge, enhancing the gaming experience.                                                 |
| ADD_TO_WISHLIST      | This event is triggered when a user adds an item or content to their wishlist or favorites list, indicating user interests.                                                        |
| SPENT_CREDITS        | SPENT_CREDITS events are recorded when users spend in-app credits or currency. Useful for tracking virtual economy interactions.                                                   |
| RATE                 | Use RATE events to track when users provide ratings or reviews for your application. Valuable for feedback collection and user sentiment analysis.                                 |
| START_TRIAL          | The START_TRIAL event is logged when a user begins a trial or free trial period for a paid service. Useful for monitoring trial conversions.                                       |
| LIST_VIEW            | LIST_VIEW events can be used to track when users view lists or catalog pages in your application.                                                                                  |
| VISITATION           | VISITATION events are logged when a user visits a particular location or venue within your application, such as a physical store in a retail app.                                  |
| CUSTOM_EVENT_1       | These custom events are placeholders for user-defined events with associated codes. You can define their meanings according to your application's specific actions and objectives. |
| CUSTOM_EVENT_2       |                                                                                                                                                                                    |
| CUSTOM_EVENT_3       |                                                                                                                                                                                    |
| CUSTOM_EVENT_4       |                                                                                                                                                                                    |
| CUSTOM_EVENT_5       |                                                                                                                                                                                    |

When using the `sendEvent` function, make sure to provide the correct event name according to your tracking requirements.

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