Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.
Jasmine Anteunis edited this page Jan 15, 2019 · 17 revisions

SAP Conversational AI - SDK Node.js

SAP Conversational AI official SDK in Node.js

Synospis

This module is a wrapper around the SAP Conversational AI API, and allows you to:

Installation

Install the package using npm, as shown below:

npm install --save sapcai

You can now use the SDK in your code. All you need is your bot's token. In case you have enabled our versioning feature in the settings of your bot, you can refer to our versioning documentation to learn how to select the appropriate token for you versions and environments.

Note: The train API needs to be initialized with the bot version. If versioning is not enabled for the bot, the default v1 should be used. For more info see our documentation on versioning.

ES5

Using the entire SDK:

var sapcai = require('sapcai').default

var client = new sapcai('YOUR_TOKEN')

Extracting one single API:

var sapcai = require('sapcai').default

var request = new sapcai.request('YOUR_TOKEN')

ES6

Using the entire SDK:

import sapcai from 'sapcai'

const client = new sapcai('YOUR_TOKEN')

Extracting one single API:

import { request } from 'sapcai'

const requestClient = new request('YOUR_TOKEN')

More

You can view the whole API reference at cai.tools.sap/docs/api-reference.

Clone this wiki locally