kotak-cloud
v0.0.2
Published
Client SDK to use Kotak Cloud
Downloads
1
Maintainers
Readme
KotakCloud SDK
This is the Official Browser client/library for kotak.cloud API.
Installation
To install kotakcloud in a node project:
npm install --save kotak-cloud
Usage
const { KotakCloudClient } = require("kotak-cloud");
const kotakCloud = new KotakCloudClient();
Authentication
Use kotakcloud auth services for get your token.
Register
const { user, token, error } = await kotakCloud.register({
firstName: "Ega",
lastName: "Radiegtya",
email: "[email protected]",
password: "password",
});
Login
const { user, token, error } = await kotakCloud.login({
email: "[email protected]",
password: "password",
});
User
const { user, error } = await kotakCloud.user();
Logout
const { user, token, error } = await kotakCloud.logout();
Files
Upload Files
async function handleFileSelect(event) {
const files = event.target.files;
await kotakCloud.uploadFiles(
files, // files to upload
"", // folder parent
console.log // onProgress
);
}
Create Folder
const { data, error } = await kotakCloud.createFolder({ name, parentId });
Get Files
const { data, total, error } = await kotakCloud.getFiles();
Get Breadcrumbs
const breadcrumbs = await kotakCloud.getBreadCrumbs("622e89eb384d39937fd79777");
Delete files
const { data, errors } = await kotakCloud.deleteFiles(files);