Initialize the Integration
The WorqHat Node SDK is a comprehensive library that allows developers to interact with the WorqHat API. It provides a simple and intuitive interface to access various AI services along with other Database, Chat, Email, Workflow and Document Management services.
This library provides convenient access to the WorqHat AI Models from TypeScript or JavaScript.
To learn how to use the WorqHat APIs, check out our API Reference and Documentation.
Installation
You can install the WorqHat Node SDK via npm or yarn:
npm install worqhat
Usage
First, you need to import the Worqhat SDK and initialize it with your API key:
const worqhat = require("worqhat");
var config = new worqhat.Configuration({
apiKey: "your-api-key",
debug: true,
max_retries: 3,
});
worqhat.initializeApp(config);
Here are the configuration options you can set when initializing the Worqhat SDK:
Option | Description | Required |
---|---|---|
apiKey | The API key used for authentication. This key is required to access the API services. | Yes |
debug | If set to true , the SDK will log debug information to the console. Default value is false . | No |
max_retries | The maximum number of retries to attempt for a request. The default value is 2 . Max limit is 5 . | No |
Alternative Initialization
You can also initialize the WorqHat SDK by setting the WORQHAT_API_KEY
environment variable:
WORQHAT_API_KEY=your-api-key
Our Suggestion: For the most Security, we suggest using ENV
variables
and using it in the Initialization code
Please note that only code that sends a request from Client-Side requires
authentication. If you are using our NodeSDKs or sending request from Server
Code, it will not be restricted. In such scenarios you can add your API-Key to
the .env
file. Make sure you protect your API-Key
properly in Server
Environments
Was this page helpful?