# react-native-precision

> Precision React SDK

Latest version **1.2.2** (published 2023-06-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-native-precision
pnpm add react-native-precision
yarn add react-native-precision
bun add react-native-precision
```

## 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.2.2 |
| Published | 2023-06-25 |
| First published | 2023-06-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 85.5 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Periculum |
| Maintainers | calebchinga |
| Keywords | precision |

## Links

- npm: https://www.npmjs.com/package/react-native-precision
- Repository: https://github.com/Periculum-io/react-native-precision
- Homepage: https://github.com/Periculum-io/react-native-precision-example
- Issues: https://github.com/Periculum-io/react-native-precision/issues
- npm.io page: https://npm.io/package/react-native-precision

## Dependencies (5)

- [axios](https://npm.io/package/axios.md) ^0.25.0
- [react-native-device-info](https://npm.io/package/react-native-device-info.md) ^8.4.8
- [react-native-permissions](https://npm.io/package/react-native-permissions.md) ^3.2.0
- [react-native-get-location](https://npm.io/package/react-native-get-location.md) ^2.2.1
- [react-native-get-sms-android](https://npm.io/package/react-native-get-sms-android.md) ^2.1.0

## Recent versions

- 1.2.2 (latest) — 2023-06-25
- 1.2.1 — 2023-06-25
- 1.2.0 — 2023-06-25
- 1.1.0 — 2023-06-25

## README

# react-native-precision

Precision library is a powerful & easy to use data enrichment tool for customer profiling.

## Badges

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Installation

Add react-native-precision to your project by running;

Yarn

```bash
yarn add react-native-precision
```

NPM

```bash
npm install react-native-precision
```

&nbsp;

## Info

You need to have a precision client account for this plugin to work. And also install the following packages for the plugin to work perfectly.

- react-native-device-info
- react-native-get-location
- react-native-get-sms-android
- react-native-permissions

&nbsp;

## Android Permissions

Please make sure you add the following android permissions in your AndroidManifest.xml file

```bash
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
```

&nbsp;

## Precision Analytics 

How to use the Precision Analytics method.
If you are using the V2 SDK methods then do the following:

Example:

```javascript
import React from 'react';
import {analyticsRequestV2} from 'react-native-precision';

await analyticsRequestV2(publicKey, statementName, customerMobile, customerBvn)
  .then(result => {
    console.log({result});
  })
  .catch(error => {
    console.log({error});
  });
```

## Precision Analytics V2 Parameters

| Name           | Description                                             | Type   | Required |
| -------------- | ------------------------------------------------------- | ------ | --------|
| publickey      | Public Key attached to account                          | String | Yes     |
| customerRef    | unique application refence                              | String | No      |
| customerMobile | customer phone number                                   | String | Yes     |
| customerBvn    | customer bvn                                            | String | No      |


## Response 
Insights will return an overview key.
You can send this overview key back to your backend server. Your backend server will use it's client credentials to make a to the insights mobile v2 endpoints for details related to the overview key.

&nbsp;
&nbsp;

## Updating an existing mobile analytics

If you have a previously generated mobile overview key, you can update it with a new SDK data. to do this make the following call:

Example:

```javascript
import React from 'react';
import {patchV2} from 'react-native-precision';

patchV2(
  publicKey,
  statementKey,
  identificationData,
)
  .then(result => {
    console.log(result);
  })
  .catch(error => {
    console.log(error);
  });
```

## Updating an existing mobile V2 Analytics parameters

| Name               | Description                                           | Type   | Required |
| ------------------ | ----------------------------------------------------- | ------ | -------- |
| publicKey          | Public Key attached to the client account             | String | Yes      |
| statementKey       | Unique statement reference                            | int    | Yes      |
| identificationData | Array of object with keys of IdentifierName and Value | array  | Yes      |


## Response 
Insights will update the previous overview key data with the latest data.
You can use the overview key in your backend server with it's client credentials to make a call to the insights mobile v2 endpoints for details related to the overview key.

&nbsp;
&nbsp;

## Setup

In order to utilize any of the SDK methods, you must have a public key. If you have not obtained your client public key, then you should contact Periculum standard support channel (email support@periculum.io).


&nbsp;

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License

[MIT](https://choosealicense.com/licenses/mit/)

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