Installation
To install the Optave JavaScript SDK, use npm:
npm install @optave/client-sdk
or yarn
yarn add @optave/client-sdk
Configuration
Before using the SDK, you need to configure it with the necessary parameters. The primary configuration options include:
- websocketUrl: The URL for the WebSocket connection.
- authenticationUrl: (Optional) The URL for authentication, if you intend to use the authenticate method.
- clientId: (Optional) Your client ID for authentication, if you intend to use the authenticate method.
- clientSecret: (Optional) Your client secret for authentication, if you intend to use the authenticate method.
Example Configuration
import OptaveJavaScriptSDK from '@optave/client-sdk';
const client = new OptaveJavaScriptSDK({
websocketUrl: process.env.OPTAVE__WEBSOCKET_URL,
authenticationUrl: process.env.OPTAVE__AUTHENTICATION_URL,
clientId: process.env.OPTAVE__CLIENT_ID,
clientSecret: process.env.OPTAVE__CLIENT_SECRET,
});