@safeguard-apis/sg-device
v3.6.0
Published
SafeGuard device authenticator library.
Downloads
536
Readme
SafeGuard Device Auth Lib
SafeGuard device authenticator library.
Installation
Using npm:
npm install --save @safeguard-apis/sg-device
# deviceId
npm install --save react-native-device-info
react-native link react-native-device-info
or using yarn:
yarn add @safeguard-apis/sg-device
# deviceId
yarn add react-native-device-info
react-native link react-native-device-info
Usage
import { SafeGuard } from "@safeguard-apis/sg-device"
const safeGuard = new SafeGuard(API_KEY)
safeGuard.createDeviceKey(USER_ID)
const signature = safeGuard.generateSignature({
httpVerb: HTTP_VERB,
domain: DOMAIN
})
See API Documentation for more details.
Contributing
Setup development environment
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Prerequisites
Install npm dependencies
docker-compose run --rm --no-deps app npm install
Now your local machine is ready for development and testing.
Running the tests
docker-compose run --rm --no-deps app npm test
Deployment
Pushes a commit to master with the message Release 1.2.3, the npm-publish action will create a new tag v1.2.3 and publish the package to the npm registry.