@kaana/kaana-services-js
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@kaana/kaana-services-js", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Kaana Services is a JavaScript library that provides an API for the Kaana ecosystem, allowing developers to easily connect and make authenticated HTTP requests to get information about users and other applications.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,1 +0,87 @@ | ||
# KaanaServices-JS | ||
# 🚀 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: | ||
```shell | ||
npm install kaana-services | ||
``` | ||
## Usage | ||
To get started with Kaana Services, import the functions or classes you need in your JavaScript file: | ||
```javascript | ||
import { login, logout, fetchData } from "kaana-services"; | ||
// Login to Kaana | ||
login("username", "password") | ||
.then((token) => { | ||
// Do something with the session token | ||
}) | ||
.catch((error) => { | ||
// Handle errors here | ||
}); | ||
// Get data from Kaana | ||
fetchData("/v1/data") | ||
.then((data) => { | ||
// Do something with the retrieved data | ||
}) | ||
.catch((error) => { | ||
// Handle errors here | ||
}); | ||
// Logout from Kaana | ||
logout() | ||
.then(() => { | ||
// The session has been closed | ||
}) | ||
.catch((error) => { | ||
// Handle errors here | ||
}); | ||
``` | ||
You can also use the `Data` and `DataCollection` classes to interact with the application's database: | ||
```javascript | ||
import { Data, DataCollection } from "kaana-services"; | ||
// Create an instance of the Data class | ||
const data = new Data(); | ||
// Get all data | ||
data | ||
.getAll() | ||
.then((allData) => { | ||
// Use all data here | ||
}) | ||
.catch((error) => { | ||
// Handle errors here | ||
}); | ||
// Create an instance of the DataCollection class | ||
const collectionName = "myCollection"; | ||
const collection = new DataCollection(collectionName); | ||
// Get all data from the collection | ||
collection | ||
.getAll() | ||
.then((allData) => { | ||
// Use all data here | ||
}) | ||
.catch((error) => { | ||
// Handle errors here | ||
}); | ||
``` | ||
## Contributing | ||
If you want to contribute to Kaana Services, that would be great! Check out [CONTRIBUTING.md](./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](./LICENSE) file for more information. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4859
88