@difenz/watch-sdk-ts v0.0.60
Installation
npm i @difenz/watch-sdk-tsDocumentation
Instantiate the auth instance with api_key. You can obtain the keys from the dashboard app.
//For Node
const watchSdk = require("@difenz/watch-sdk-ts");
//For Typescript
import * as watchSdk from '@difenz/watch-sdk-ts';
const watchSdk = new watchSdk.Auth('XXXXXXXXXXXXX');The resources can be accessed via the instance created.
watchSdk.verifyUser(user, (err,user)=>{
if(user){
// handle response
}else{
// handle error
}
});const transaction = new WatchSdk.Transaction();
transaction.setTransactionUserId(user.user_id);
transaction.setTransactionUserSession(user);watchSdk.submitTransaction(transaction, (err, data)=>{
if(data){
// handle response
}else{
// handle error
}
});Address
Instantiate the address instance.
const address = new watchSdk.Address();Methods for address
Card
Instantiate the card instance.
const card = new watchSdk.Card();Methods for card
Device
Instantiate the address instance.
const device = new watchSdk.Device();Methods for device
User
Instantiate the address instance.
const user = 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 |
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago