# react-native-contlo

> SDK for capturing shop events for your app, built using React Native.

Latest version **1.3.0-beta.2** (published 2022-11-29) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0-beta.2 |
| Published | 2022-11-29 |
| First published | 2022-09-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 15.6 MB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| Author | Rupam Kerketta, Mr.Khan |
| Maintainers | rupam-kerketta, hertzbit |
| Keywords | sdk, contlo, react-native, apis |

## Links

- npm: https://www.npmjs.com/package/react-native-contlo
- npm.io page: https://npm.io/package/react-native-contlo

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^0.27.2
- [validator](https://npm.io/package/validator.md) ^13.7.0
- [@react-native-async-storage/async-storage](https://npm.io/package/@react-native-async-storage/async-storage.md) ^1.17.11

## Recent versions

- 1.3.0-beta.2 (latest) — 2022-11-29
- 1.2.0-beta.1 (beta) — 2022-10-14
- 1.3.0-beta.1 — 2022-11-29
- 1.3.0-beta.0 — 2022-11-29
- 1.2.0-beta.0 — 2022-09-29
- 1.1.0 — 2022-09-22
- 1.0.2 — 2022-09-08

## README

# React Native Contlo
## SDK Installation

Install Contlo's React Native plugin using the npm package manager.

```
$ cd path_to_your_project
```
Add the contlo plugin from npm

```
$ npm install react-native-contlo
```

**Please note**: if you're using Expo for development, be sure to be using the "bare workflow".

## ContloAPI Usage
```js
import { ContloAPI } from 'react-native-contlo'

// Init ContloAPI with your Stores public API key
// call this function in your index.js file
ContloAPI.init({apiKey: '<YOUR_API_KEY>'})

// Set email, phone one of the fields is mandatory for sending a request
ContloAPI.set.userEmail('john@example.com')
ContloAPI.set.userPhone('+912223334444')

// Set methods (optional)
ContloAPI.set.userFirstName('John')
ContloAPI.set.userLastName('Doe')
ContloAPI.set.userCity('bangalore')
ContloAPI.set.userProvince('')
ContloAPI.set.userZip('560010')
ContloAPI.set.userCountry('india')

// Get methods 
ContloAPI.get.userEmail()
ContloAPI.get.userPhone()
ContloAPI.get.userFirstName()
ContloAPI.get.userLastName()
ContloAPI.get.userCity()
ContloAPI.get.userProvince()
ContloAPI.get.userZip()
ContloAPI.get.userCountry()

// Events Template
// Template for sending any custom/user Events to contlo (events)
// {
//   "event": "<event_key>",
//   "email": "john@example.com",
//   "phone_number": "+912223334444",
//   "properties": {
//     "key1": "<key1>",
//     "key2": <key2>,
//   }
// }

// Template Profile Identification (create/set customer profile)
// {
//   "custom_properties": {
//     "property1": "<value1>",
//     "property2": "<value2>",
//   },
//   "first_name": "John",
//   "last_name": "Doe",
//   "email": "john@example.com",
//   "phone_number": "+12223334444",
//   "country": "india",
//   "zip": "560010",
//   "city": "bangalore"
// }

// If you don't want to send customProperties just pass in an empty object {}

// Send methods (async methods) - return type promise
ContloAPI.send.event({event: event, properties: properties})
ContloAPI.send.profile({customProperties: customProperties})
```

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