🚀 Kaana Services
Kaana Services is a JavaScript library for building apps that integrate with the Kaana ecosystem. It provides an API gateway for authenticating users and making requests to Kaana services, as well as a set of data classes for working with the app's database.
Installation
To install Kaana Services in your project, simply run the following command in your terminal:
npm install kaana-services
Usage
To get started with Kaana Services, import the functions or classes you need in your JavaScript file:
import { login, logout, fetchData } from "kaana-services";
login("username", "password")
.then((token) => {
})
.catch((error) => {
});
fetchData("/v1/data")
.then((data) => {
})
.catch((error) => {
});
logout()
.then(() => {
})
.catch((error) => {
});
You can also use the Data
and DataCollection
classes to interact with the application's database:
import { Data, DataCollection } from "kaana-services";
const data = new Data();
data
.getAll()
.then((allData) => {
})
.catch((error) => {
});
const collectionName = "myCollection";
const collection = new DataCollection(collectionName);
collection
.getAll()
.then((allData) => {
})
.catch((error) => {
});
Contributing
If you want to contribute to Kaana Services, that would be great! Check out CONTRIBUTING.md to learn more about how you can help improve the library.
License
Kaana Services is distributed under the MIT license. See the LICENSE file for more information.