Skip to the content.

react-native-sensie-module

  React Native Sensie SDK.

Installation

   Install via yarn. Link it and install dependencies for ios.

yarn add react-native-sensie-module
npx react-native link
cd ios && pod install

Usage

Import

   Import SensieEngine and CalibrationSession class.

import { SensieEngine } from "react-native-sensie-module";

Initination

   Pass the generated token for Sensie SDK.

const s = new SensieEngine({accessToken: '[Token]'})

Connection

   A method to establish a connection. It should return a promise that will tell us if the connection was successful.

await s.connect()

   Also, canRecalibrate property will be set depending on stored sensies in storage.

Calibration

calibrationSession = await s.startCalibration({
    userId,
    onEnds: (result) => {
    }
})

   result will be an object with a single property contains calibration strength.

Capturing Sensie

const sensie = await calibrationSession.captureSensie({
    flow,
    onSensorData: (data) => {
    }
})

   sensie will be an object with the following properties:

   flow is boolean value(true or false)

   onSensorData is a callback function that will be called every time we have new values from the sensors (optional)

   data will be an object with the following properties:

Resetting

   Reset storage if you want to recalibrate.

await s.resetCalibration();

Evaluation

await s.startEvaluation(userId) // creation of evaluation session

const sensie = await s.captureSensie({
  userId,
  onSensorData: (data) => {}, // (optional)
});

   sensie object will be an object with the following properties:

Setting agreement

enum Agreement {
  Agree = 1,
  Disagree = -1,
  AgreeAfterReflecting = 2,
}

sensie.setAgreement(Agreement.Agree)


Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

Proprietary Software