README
BAT VYPE WEBSDK
Motivation
The purpose of this repository is to create a sdk as a wrapper around Bluetooth Web API. The goal has been to read and write data from Vype ePod devices.
Unfortunately, some browsers are not compatible with Web Bluetooth, so we recommend Google Chrome and Bluefy (iOS Devices) as a reliable browser to connect with your device.
How to install and run the project
To run the application we recommend using
yarn
as your dependency manager.
Once you have cloned this repository install the project dependencies by running in the terminal:
yarn install
How to access and install the SDK via NPM & GitHub Packages
In the same directory as your package.json file, create or edit an .npmrc file to include a line specifying GitHub Packages URL and the account owner.
//npm.pkg.github.com/:_authToken=<auth token given to you>
registry=https://npm.pkg.github.com/nodes-projects
Install from the command line:
$ npm install @nodes-projects/bat-sdk-web@0.0.1
Install via package.json:
"@nodes-projects/bat-sdk-web": "0.0.1"
Dependencies
"devDependencies": {
"@types/web-bluetooth": "^0.0.9",
"@typescript-eslint/eslint-plugin": "^4.5.0",
"@typescript-eslint/parser": "^4.5.0",
"eslint": "^7.11.0",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-config-prettier": "^6.14.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.1.4",
"prettier": "^2.1.2",
"typescript": "^4.0.3"
}
Note: Your local npm version should be higher than 8.
Testing the project
Once all the dependencies have been installed you can test the project by executing the following run command in the terminal:
yarn link
The command will generate a symlink to batSDK by which sdk can be connected to testing app.
Usage
Check here how to use the SDK.
ePod read helpers
- getBatteryInfo()
- getBatteryChargeLevel()
- getBatteryChargingState()
- getTime()
- getLockStatus()
- getLedBrightness() ...
ePod write helpers
- setLockStatus()
- setLedBrightness()
- setTime() ...
Need help?
- File an issue via GitHub Issues
Sample App
Check out our sample app to try it yourself!
git clone https://github.com/nodes-projects/bat-vype-react-js.git
yarn install
yarn start