1.1.0 • Published 9 months ago

@innerworks-me/iw-mobile-auth v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago
# Metrics Plugin

The `Metrics` plugin is a Capacitor-based solution designed to collect and retrieve essential metrics from mobile devices. This tool is particularly useful for applications requiring detailed analytics, diagnostics, and performance tracking. It integrates seamlessly into Ionic applications using Capacitor.

## Installation

Install the plugin with the following commands:

```bash
npm i @innerworks-me/iw-mobile-auth
npx cap sync

This ensures that the plugin is properly integrated into your Capacitor project.

API Overview

The plugin provides two primary methods for collecting and handling data:

API Documentation

textOnChange(...)

textOnChange(typing: any) => Promise<{}>
ParamType
typingany

Returns: Promise<{}>


setOptionalData(...)

setOptionalData(data: string) => Promise<{}>
ParamType
datastring

Returns: Promise<{}>


sendCollectedData(...)

sendCollectedData(data: any) => Promise<{}>
ParamType
dataany

Returns: Promise<{}>

Important Note: After calling the sendCollectedData() function, data collection will be finalized, and any further metrics from textOnChange() or setOptionalData() will not be included in the payload.


Usage Examples

Monitoring Text Changes

To monitor text changes and handle input events:

import { Metrics } from '@innerworks-me/iw-mobile-auth';

Metrics.textOnChange({ typing: 'Hello, World!' })

Setting Optional Data

To set some optional data into payload, please use this function:

import { Metrics } from '@innerworks-me/iw-mobile-auth';

Metrics.setOptionalData({ data: 'Some optional data' })

Sending Collected Data

To send collected data with an associated social ID and project ID:

import { Metrics } from '@innerworks-me/iw-mobile-auth';

Metrics.sendCollectedData({
    socialId: '12345',
    projectId: 'ds012w1dk90kw209dks01'
  })
1.1.0

9 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago