# KSoft.js

{% hint style="info" %}
this documentation is for version 3.0 or later.\
If you're on an older version, please run `npm i @ksoft/api` as there's been a lot of performance improvements.
{% endhint %}

Every API call in KSoft.js is asynchronous, meaning the it return a promise.

As an example, this is how you'd use the random-aww endpoint:

```javascript
const { KSoftClient } = require('@ksoft/api');

const ksoft = new KSoftClient('your-very-nice-token');

/* I use a helper asnyc function called main here.
 * This would also work using a lambda function or class method,
 * as long as it's asynchronous.
 */
async function main() {
    const { url } = await ksoft.images.aww();
    message.channel.send(url); // discord.js
}

main();
```

{% hint style="info" %}
There's two official versions of the wrapper on NPM.

The stable version is available at **@ksoft/api** and is generally recommended.\
Nightly builds are available at **@aero/ksoft** and should only be used if you want to actively want to give feedback on development or really know what you're doing.
{% endhint %}

{% hint style="warning" %}
In the following documentation, all required arguments will be marked **bold**.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://js.docs.ksoft.si/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
