0.0.12 • Published 3 years ago
difenz-watch v0.0.12
Installation
npm i difenz-watch
Documentation
Instantiate the auth instance with api_key. You can obtain the keys from the dashboard app.
//For Node
const WatchSdk = require("difenz-watch");
//For Typescript
import * as WatchSdk from 'difenz-watch';
const testWatchSdk = new WatchSdk.Auth('XXXXXXXXXXXXX');
The resources can be accessed via the instance created.
testWatchSdk.pushUserData(testUser, (err,res)=>{
if(res){
// handle response
}else{
// handle error
}
});
Address
Instantiate the address instance.
const testAddress = new WatchSdk.Address();
Methods for address
Agent
Instantiate the address instance.
const testAgent = new WatchSdk.Agent();
Methods for agent
Card
Instantiate the card instance.
const testCard = new WatchSdk.Card();
Methods for card
IP
Instantiate the ip instance.
const testIP = new WatchSdk.IP();
Methods for IP
User
Instantiate the address instance.
const testUser = new WatchSdk.User();
Methods for User
Error Responses
Error Codes | Description |
---|---|
MIN_FIELD_REQUIRED | At Least one field is required |
INVALID_API_KEY | API_KEY not valid |
INVALID_CLIENT | Client not valid |
UNKNOWN_ERROR | Unknown error |
DATA_UNAVAILABLE | Data not found |