sb-sdk
An SDK for all your ServisBOT Needs
Goal
- Lightweight SDK to interact with ServisBOTs AWS4 signed APIs across many clients including
** portal
** servisbot cli
Install
npm install --save @servisbot/sb-sdk
BREAKING CHANGES
From version 6.6.0 onwards - SB.Auth now requires two new parameters for working with lithium resources - lithiumHttpApiUrl and cognitoJwtToken
8.0.0 - Changes to AuthProfile contracts to move towards consistency with lithium
12.0.0 - Changes to a number of the metric requests - start and end are no longer epoch timestamps
- queryUserInput
- queryDAUMetrics
- queryAPIMetrics
- querySessionEventMetrics
- QueryRestrictionGroupMetrics
15.0.0 - Drawbridge Removed
- Remove Security Class
- Remove create,join,leave,message functions from conversation
Getting Started
Auth
The Auth class requires Organization, Bullseye Url, Virtual Assistant URL, lithiumHttpApiUrl and Credentials for aws4 signed requests.
- A function that returns the credentials
- An object containing the credentials
To work with Lithium a cognito cognitoJwtToken is required, this is the token passed to cognito to get user pool details.
SDK clients also take a client name, to help identify where SDK requests are originating from - e.g. @servisbot/myClient@1.0.0
.
As an object
const fetch = require('node-fetch') || window.fetch;
const SB = require('@servisbot/sb-sdk')(fetch, "@servisbot/myClient@1.0.0");
const auth = new SB.Auth({
organization: '<Your Organization>',
bullseyeUrl:'<ServisBOT bullseye url>',
virtualAssistantUrl:'<ServisBOT virtual assistant url>',
brocaUrl:'<ServisBOT broca url>',
metrickyUrl:'<ServisBOT metricky url>',
credentials:{
accessKeyId: '<Access Key Id>',
secretAccessKey: '<Secret Access Key>',
sessionToken: '<Session Token>'
},
cognitoJwtToken: '<JWT Token>',
timezone:'<Your local timezone (optional)>'
});
As a function, async supported
const fetch = require('node-fetch') || window.fetch;
const SB = require('@servisbot/sb-sdk')(fetch, "@servisbot/myClient@1.0.0");
const auth = new SB.Auth({
organization: '<Your Organization>',
bullseyeUrl:'<ServisBOT bullseye url>',
credentials: () => async getYourCredentials(),
cognitoJwtToken: '<JWT Token>'
});
Entities
Organization
AuthProfile
Bot
Worker
Endpoint
Conversation
EngagedConversation
Endpoint
Blueprint
APIConnector
RestrictionGroup
Secret
Goal
VirtualAssistant
User
SbApp
Project
Metric
Conversion
Intent
Job
MissedInput
Log
Slot
Content
ChatHistoryServer
IntentTraining
NLU
IntentTraining
AWS External Resources
Remote NLU
Pathway
Monitoring
Alarm
Email Template
Entity
Form
LargeLanguageModel
Subflow
CRM