Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sassoftware/conversation-designer-components

Package Overview
Dependencies
Maintainers
7
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sassoftware/conversation-designer-components - npm Package Compare versions

Comparing version 0.0.0-preview.1 to 0.1.0

2

package.json

@@ -1,1 +0,1 @@

{"name":"@sassoftware/conversation-designer-components","version":"0.0.0-preview.1","license":"SEE LICENSE IN LICENSE.txt","author":{"name":"SAS"},"repository":{"type":"git","url":"https://github.com/sassoftware/conversation-designer-sdk.git"},"assets":"assets","keywords":["SAS","Viya","Conversation","Designer","SDK","chatbot","bot"]}
{"name":"@sassoftware/conversation-designer-components","version":"0.1.0","license":"Apache-2.0","author":{"name":"SAS"},"homepage":"https://github.com/sassoftware/conversation-designer-sdk#readme","repository":{"type":"git","url":"https://github.com/sassoftware/conversation-designer-sdk.git"},"assets":"assets","keywords":["SAS","Viya","Conversation","Designer","SDK","chatbot","bot"]}

@@ -5,13 +5,13 @@ # SAS Conversation Designer SDK

The SAS Conversation Designer SDK is a set of JavaScript APIs and web components that enable SAS Conversation Designer chatbots to be easily embedded in a third-party application or web page. This functionality is delivered as the `conversation-designer-components` JavaScript library. This project provides examples of how to use the SDK components in various scenarios.
The SAS Conversation Designer software development kit (SDK) is a set of JavaScript APIs and web components that enable SAS Conversation Designer chatbots to be easily embedded in a third-party application or web page. This functionality is delivered as the `conversation-designer-components` JavaScript library. This project provides examples of how to use the SDK components in various scenarios.
# Prerequisites
Access to a deployment of SAS Conversation Designer and a bot are required in order to use the SDK. For more information about server set up, see the <a target="_blank" href="https://developer.sas.com/sdk/va/docs/getting-started#sas-viya-setup">SAS Viya setup</a> section. Note that the other sections on the Getting Started page are specific to SAS Visual Analytics and not this SDK.
Access to a deployment of SAS Conversation Designer and a bot are required in order to use the SDK. For more information about server set up, see the <a target="_blank" href="https://developer.sas.com/sdk/va/docs/getting-started#sas-viya-setup">SAS Viya setup</a> section. Note that the other sections on the Getting Started page are specific to SAS Visual Analytics and not the SAS Conversation Designer SDK.
# Installation
### NPM
### npm
The <a target="_blank" href="https://www.npmjs.com/package/@sassoftware/conversation-designer-components">`@sassoftware/conversation-designer-components`</a> library is published to NPM and can be installed by running the `npm install` command as shown below. `conversation-designer-components` does not support ES6 imports. Therefore, the contents of the `conversation-designer-components/dist` folder must be deployed with your page, and then loaded using a `script` tag.
The <a target="_blank" href="https://www.npmjs.com/package/@sassoftware/conversation-designer-components">`@sassoftware/conversation-designer-components`</a> library is published to <a target="_blank" href="https://www.npmjs.com/">npm</a> and can be installed by running the `npm install` command as shown below. `conversation-designer-components` does not support ES6 imports. Therefore, the contents of the `conversation-designer-components/dist` folder must be deployed with your page, and then loaded using a `script` tag.

@@ -29,3 +29,3 @@ ```bash

```html
<script async src="./sdk-assets/dist/umd/conversation-designer-components.js"></script>
<script async src="./sdk-assets/conversation-designer-components.js"></script>
```

@@ -36,3 +36,3 @@

Accessing the `conversation-designer-components` library from a CDN is easy. It does not require installation or
hosting of the library code and assets. There are several public options for accessing NPM content through a CDN, such
hosting of the library code and assets. There are several public options for accessing npm content through a CDN, such
as <a target="_blank" href="https://unpkg.com/">UNPKG</a> and <a target="_blank" href="https://www.jsdelivr.com/">jsDelivr</a>. Here is an example of loading the 0.1.0 version of `conversation-designer-components` from UNPKG

@@ -42,3 +42,3 @@ using an HTML `script` tag. When used in production, the version should be pinned to the full `major.minor.patch` semantic version.

```html
<script async src="https://unpkg.com/@sassoftware/conversation-designer-components@0.1.0/dist/umd/conversation-designer-components.js"></script>
<script async src="https://unpkg.com/@sassoftware/conversation-designer-components@0.1.0/conversation-designer-components.js"></script>
```

@@ -48,11 +48,11 @@

When using the SDK there is some information that must be provided to configure the components. Where/how these values are used is covered in the [API section](#API). Following is a description of each attribute:
When using the SAS Conversation Designer SDK, you must provide some information to configure the components. For information on the values you should provide and where they should go, see the [API section](#API). Following is additional information about some of the attributes:
- url - this value points to the base url of your SAS environment (ex: if SAS Conversation Designer was deployed to http://yourcompany.com/SASConversationDesigner, then set this value to http://yourcompany.com)
- botUri - this is the unique identifier for the bot you want the component to communicate with (ex: /naturalLanguageConversations/bots/e3b1f772-1562-4c8c-a60e-1ee20684ce4b)
- revisionId - this is the unique identifier for the bot revision within your bot that the component will communicate with; this could be a delegate value (ex: @published, @latest) or the UUID (ex: aa1e4567-e89b-12d3-a456-426614158700)
- url - this value points to the base url of your SAS environment (for example, if SAS Conversation Designer was deployed to http://yourcompany.com/SASConversationDesigner, then set this value to http://yourcompany.com)
- botUri - this is the unique identifier for the bot that you want the component to communicate with (for example, /naturalLanguageConversations/bots/e3b1f772-1562-4c8c-a60e-1ee20684ce4b)
- revisionId - this is the unique identifier for the bot revision within your bot that the component will communicate with; this could be a delegate value (for example, @published, @latest) or the universally unique identifier (UUID) (for example, aa1e4567-e89b-12d3-a456-426614158700)
## Examples
Full examples are located in the [examples folder](./examples/) of this repository.
Full examples are located in the [examples folder](https://github.com/sassoftware/conversation-designer-sdk/blob/HEAD/examples/) of this repository.

@@ -63,3 +63,3 @@ # API

SASChatElement is a custom HTML element that renders a chat window. This element extends HTMLElement.
The SASChatElement is a custom HTML element that renders a chat window. This element extends the HTMLElement.

@@ -83,4 +83,4 @@ To find the correct values for the url, botUri, and revisionId attributes, see the [Getting Started](#Getting-Started) section.

- 'guest' automatically signs in to the SAS Viya server as the guest user.
- 'credentials' uses SAS Logon to establish an authenticated session.
- 'guest' automatically signs in to the SAS Viya server as the guest user (authenticationType="guest").
- 'credentials' uses SAS Logon to establish an authenticated session (authenticationType="credentials").

@@ -95,7 +95,7 @@ default value: 'credentials'

Specify the bot URI.
Specify the bot URI ([How do I find the botUri for my bot?](#How-do-I-find-the-botUri-for-my-bot)).
> revisionId: string
Specify the revision Id.
Specify the revision ID ([How do I find the revisionId for my bot?](#How-do-I-find-the-revisionId-for-my-bot)).

@@ -106,19 +106,19 @@ default value: '@published'

Specify the user id. This value is only used when authenticationType is 'guest'. This is only used for tracking/display and is not related to authorization or security.
Specify the user ID. This value is only used when the value of the authenticationType parameter is 'guest'. This is only used for tracking/display and is not related to authorization or security.
default value: user id of authenication Viya user
default value: the user ID of the authenticated Viya user
> userName: string
Specify the user name. This value is only used when authenticationType is 'guest'. This is only used for tracking/display and is not related to authorization or security.
Specify the user name. This value is only used when the value of the authenticationType parameter is 'guest'. This is only used for tracking/display and is not related to authorization or security.
default value: user name of authenication Viya user
default value: user name of the authenticated Viya user
> connectorName: string
Specify the name of the connector displayed in the bot history view
Specify the name of the connector that displays session history in the History workspace.
> sessionProperties: Object
Specify a JSON object containing data to add to the chat session at creation.
Specify a JavaScript Object Notation (JSON) object that contains data to add to the chat session when it is created.

@@ -129,11 +129,68 @@ ### Properties

A JavaScript function that will be called for all chat events.
A JavaScript function that is called for all chat events.
### Styles
SASChatElement supports styling certain parts of the chat interface via [CSS variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties).
> --sas-chat-bot-avatar-bg
Specify the background color of the bot avatar.
> --sas-chat-bot-avator-bd
Specify the border color of the bot avatar.
> --sas-chat-bot-avator-c
Specify the text color of the bot avatar.
> --sas-chat-user-avatar-bg
Specify the background color of the user avatar.
> --sas-chat-user-avatar-bd
Specify the border color of the user avatar.
> --sas-chat-user-avatar-c
Specify the text color of the user avatar.
> --sas-chat-timestamp-c
Specify the text color of the timestamps.
> --sas-chat-bot-response-bubble-bg
Specify the background color of the bot response bubbles.
> --sas-chat-bot-response-bubble-bd
Specify the border color of the bot response bubbles.
> --sas-chat-bot-response-bubble-c
Specify the text color of the bot response bubbles.
> --sas-chat-user-input-bubble-bg
Specify the background color of the user input bubbles.
> --sas-chat-user-input-bubble-bd
Specify the border color of the user input bubbles.
> --sas-chat-user-input-bubble-c
Specify the text color of the user input bubbles.
# Contributing
We welcome your contributions! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to submit contributions to this project.
The SAS Conversation Designer SDK is not open for external contributions.
# License
This project is licensed under the [Apache 2.0 License](LICENSE).
This project is licensed under the [Apache 2.0 License](https://github.com/sassoftware/conversation-designer-sdk/blob/HEAD/LICENSE).

@@ -146,5 +203,7 @@ # Additional Resources

## How do I find the botId for my bot?
The most common way to find the botId for a bot is using the Natural Language Conversations API (ex: if SAS Conversation Designer was deployed to http://yourcompany.com/SASConversationDesigner, then the base URL for the API would typically be http://yourcompany.com/naturalLanguageConversations). Once you have found the base URL, you can then call GET on the bots endpoint (ex: http://yourcompany.com/naturalLanguageConversations/bots). This will return a list of all bots that currently exist and you search the list for your bot. Once you find it the botId value is shown as 'id'.
## How do I find the botUri for my bot?
To find the botUri for a bot, open SAS Environment Manager. Click SAS Content -> Conversational Flows and open the folder with your bot’s name. Select the Chatbot object to see the URI in the properties pane.
Another option is to use the Natural Language Conversations API to find a bot ID. For example, if SAS Conversation Designer is deployed to http://yourcompany.com/SASConversationDesigner, then the base URL for the API would be http://yourcompany.com/naturalLanguageConversations. Using the base URL, you can call GET on the bot’s endpoint (for example, http://yourcompany.com/naturalLanguageConversations/bots). This URL returns a list of all bots that currently exist and you can then search the list for your bot. Once you find the name of your bot, the bot ID value is shown next to the id parameter.
Here is an example:

@@ -164,12 +223,12 @@

The 'id' value (ex: 7d3137bf-c306-4127-b513-3e3ab816d125) should be used as the botId mentioned above.
The value “7d3137bf-c306-4127-b513-3e3ab816d125” should be appended to '/naturalLanguageConversations/bots/' be create the botUri mentioned above.
## How do I find the revisionId for my bot?
There are three options for revisionId:
There are three options for the revisionId parameter:
- @published - (recommended) this value points to the published version of your bot, then each time a new bot version is published, the connector automatically updates to use the most recently published bot version
- @latest - this value points to the latest/draft version of your bot, then each time a new bot latest/draft is created, the connector automatically updates to use the new latest/draft bot version
- specific revision id - this value points to a specific version the bot and will not change as versions are published or created
- @published - (recommended) this value points to the published version of your bot. Each time a new bot version is published, the connector automatically updates to use the most recently published bot version.
- @latest - this value points to the latest draft version of your bot. Each time a new bot or draft is created, the connector automatically updates to use the latest draft bot version.
- specific revision ID - this value points to a specific version of the bot and does not change as versions are published or created.
To find a specific revision id, follow the above instructions on how to get the botId. Then you can use the API to get access to all of the revisions available for a bot. This can be done by calling GET on the revisions endpoint (ex: http://yourcompany.com/naturalLanguageConversations/bots/{botId}/revisions). This will return a list of all revisions that currently exist for your bot. Then find the revision you are interested in and the revision value is shown as 'id'.
To find a specific revision ID, follow the above instructions on how to get a bot ID. Then you can use the API to get access to all of the revisions that are available for a bot. This can be done by calling GET on the revisions endpoint (for example, http://yourcompany.com/naturalLanguageConversations/bots/{botId}/revisions). This URL returns a list of all revisions that currently exist for your bot after you replace {botId} with the bot ID value of your bot. Next, find the revision you are interested in. The value to use for the revisionId parameter appears by the id parameter for your bot revision.

@@ -190,6 +249,6 @@ Here is an example:

The 'id' value (ex: e09881bb-3206-4d73-a9c0-a6280202c188) should be used as the revisionId mentioned above.
The value “e09881bb-3206-4d73-a9c0-a6280202c188” should be used as the revision ID mentioned above.
## I'm getting a CORS error. How do I fix it?
When the sdk is deployed in a different domain than SAS Viya, you will need to update the SAS Viya CORS configuration to allow access. Instructions can be found on [developers.sas.com](https://developer.sas.com/reference/cors).
When the SAS Conversation Designer SDK is deployed in a different domain than SAS Viya, you must update the SAS Viya CORS configuration to allow access. Instructions can be found on [developers.sas.com](https://developer.sas.com/reference/cors).

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc