Skip to content

Kotakcloud-Team/kotak-cloud

Repository files navigation

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: "user@gmail.com",
  password: "password",
});

Login

const { user, token, error } = await kotakCloud.login({
  email: "user@gmail.com",
  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);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published