
Koxy JS by Koxy AI
Koxy AI is a no-code platform helps you build your AI-powered serverless back-end served edge-close to users from 35 regions, and Koxy JS is a client library to integrate your Koxy back-end in your front-end.

Installation
npm install koxy-js
Usage
First go to Koxy AI platform, sign up and create your Koxy Cloudspace.
You can create API flows and cloud functions in the platform and run them from your front-end as described below: (full docs)
import { koxyAPI } from 'koxy-js';
const api = new koxyAPI("CLOUDSPACE_TOKEN");
const parameters = {
"param1": "value1"
};
const data = await api.run("main", parameters);
const functionData = await api.runFunction("function_name");
Send Parameters and headers
You can send parameters and headers to your API flows. example:
import { koxyAPI } from 'koxy-js';
const api = new koxyAPI("CLOUDSPACE_TOKEN");
const parameters = {
"param1": "value1"
};
const headers = {
"customHeader": "headerValue"
};
const data = await api.run("main", parameters, headers);
Currently, You can't send parameters or headers to cloud functions.
Real-time
Real-time in Koxy AI is built on top of GunDB, It's decentralized and has no limits.
After creating a Cloudspace in Koxy AI, you can go to Real-time channels from the sidebar to get your real-time ROOT_ID and manage your real-time channels.
This feature is totally free with no limits at all.
import { koxyRealtime } from 'koxy-js';
const channel = new koxyRealtime(
"ROOT_ID",
"room_123"
);
channel.asyncPut("message_1694453447561", {
"message": "Hello friend",
"owner": "user_092",
"date": 1694453447561
}, function (data) {
console.log(data);
})
channel.put("message_1694453447561", {
"message": "Hello friend",
"owner": "user_092",
"date": 1694453447561
});
channel.on("room_123", function (data) {
console.log(data);
});
How to build your API flows
After creating your Cloudspace, go to API Flows from the sidebar, and create your first flow, just name it and you're good to go, then you can use the drag-and-drop builder to build your flow's functionality, when you're done your can save and deploy your flow to the cloud.
How to build your cloud functions (demo)
After creating your Cloudspace, go to Functions from the sidebar, and create your first function, just name it and you're good to go, now you code your cloud function, deploy it with one click and you can run it from your front-end.
Now you can run this function in the cloud from your front-end, example:
import { koxyAPI } from 'koxy-js';
const api = new koxyAPI("CLOUDSPACE_TOKEN");
const data = await api.runFunction("main_function");
Report issues
You can support us by reporting any issues you face here
License
MIT
Built with love by Kais Radwan.