task-engine-sdk
v0.0.3
Published
Create, manage and extend BHuman's Task Engine with JavaScript or TypeScript.
Downloads
3
Readme
Task Engine SDK
Create, manage and extend BHuman's Task Engine with JavaScript or TypeScript.
The type documentation can be found here.
Installation
npm i task-engine-sdk
You may also need to install
fetch
andws
depending on your environment.
Getting Started
Step 1: Define the configuration
import { Config } from "task-engine-sdk";
export const config: Config = {
clientId: "CLIENT_ID",
clientSecret: "CLIENT_SECRET",
engineSecret: "ENGINE_SECRET",
};
import { Config } from "task-engine-sdk";
import fetch from "node-fetch";
import WebSocket from "ws";
export const config: Config = {
clientId: "CLIENT_ID",
clientSecret: "CLIENT_SECRET",
engineSecret: "ENGINE_SECRET",
fetch,
WebSocket,
};
Step 2: Create a task
import { Task } from "task-engine-sdk";
const task = new Task(config, "What time is it in NYC?");
Step 3: Run the task
const result = await task.run(); // It is 12:00 PM in NYC.
Advanced Usage
Please refer to the examples for more advanced usage.