1.9.1 • Published 8 months ago
maelyn.js v1.9.1
Maelyn.js
Maelyn.js is a simple and powerful REST API client for interacting with Maelyn's services, such as chatbot integration and file uploads. This easy-to-use library helps developers quickly integrate features into their applications.
Documentation
visit:
Maelyn Group
Installation
To install the Maelyn.js client, use npm:
npm install maelyn.js
Usage Examples
1. Basic API Request
You can make simple API requests with the get()
method. Here's how you can fetch data:
const Maelyn = require('maelyn.js');
const api = new Maelyn('YOUR-APIKEY'); // Replace with your API key
api.get('geminichat', { q: 'Questions' })
.then(response => {
console.log(response); // Handle the response
})
.catch(error => {
console.error(error); // Handle any errors
});
2. API Request with Image URL
If you need to pass an image URL as a parameter, here's how to do it:
const Maelyn = require('maelyn.js');
const api = new Maelyn('YOUR-APIKEY'); // Replace with your API key
api.get('geminichat', { q: 'Questions', url: 'URL-Image' })
.then(response => {
console.log(response); // Handle the response
})
.catch(error => {
console.error(error); // Handle any errors
});
3. Fetching Latest Updates
To fetch the latest updates from the komikulastupdate
endpoint:
const Maelyn = require('maelyn.js');
const api = new Maelyn('YOUR-APIKEY'); // Replace with your API key
api.get('komikulastupdate')
.then(response => {
console.log(response); // Handle the response
})
.catch(error => {
console.error(error); // Handle any errors
});
4. File Upload Example
You can also upload files to the CDN using the uploadFile()
method (no API key required):
const Maelyn = require('maelyn.js');
const api = new Maelyn(); // No API key needed for file uploads
api.uploadFile('path/to/your/file.jpg') // Replace with the correct file path
.then(response => {
console.log('File uploaded successfully:', response); // Handle the response
})
.catch(error => {
console.error('File upload failed:', error.message); // Handle errors
});
License
This project is licensed under the MIT License.
Authors
Notes:
- API Key: Ensure you replace
'YOUR-APIKEY'
with your actual Maelyn API key in the API request examples. - File Path: When uploading a file, ensure the file path is correct.
- No API Key for File Upload: The
uploadFile()
method does not require an API key. - Endpoints: The API supports various endpoints like
geminichat
andkomikulastupdate
. Check the documentation for the full list of available endpoints.
Changes:
- Changed all instances of
maelyn-api
tomaelyn.js
.