Integration Process
The integration process is straight forward: Download and install the Web SDK, Choose the Limited or Standard Integration Furtner configure your integration (digital twin, user identity, display options)Installation
Download the Web SDK and install the Javascript file in your website
Integration
Choose between limited or standard integration option to integrate into your website
Configuration
Customize the setup to specify which Digital Twin to connect to, User Identity and various display options
Installation
Download the Pria Web SDK file and save into a local file on your web site under a file namedpria-sdk-web.js
File location:
For Canvas LMS integration, follow the Custom Theme Canvas Install Guide
Integration
You can choose the limited or standard integration depending on your level of Javascript and what you want to do with your Digital Twin.Limited Integration
Start your digital twin with minimal effort. Best to leverage the UI without programming.
Standard Integration
Integrate your digital twin securely with a bit of Javascript code and take full control through Javascript
Limited Integration
If you simply choose to embed the Digital Twin UI in your web site, (like standard Chatbots for example) you can simply add a script directive your page header like:The
pria-sdk-web.js
file is the copy of the SDK file you downloaded and installed on your website. You may choose to prepend a directory to organize your includes, like /assets/js/pria-sdk-web.js
pria-web-sdk.js
file you downloaded has an event handler that initializes the integration when the page is loaded
For enhanced security, always retrieve these values asynchronously from a secure source to prevent exposure of plaintext data in the page.
Standard Integration
For more control, and if you have a bit of Javacript knowledge, we recommend embedding the SDK with the following snippets In your web page, define a configuration properties like belowThis configuration object contains elements necessary to initialize the SDK, such as display options, digital twin selection and user identity.
The
pria-sdk-web.js
file is the copy of the SDK file you downloaded and installed on your website. You may choose to prepend a directory to organize your includes, like /assets/js/pria-sdk-web.js
Check the SDK Playground Example for a more complete example that wrapps the SDK into a class structure.
Configuration Parameters
The SDK uses 3 parameter objects to determine the look ad feel of elements on screen with the displayOptions, the Digital Twin to use using the instanceConfig and the user profile data using the userConfigDisplay Options
Configure Pria’s display behavior using thedisplayOptions
object:
Set
noUI: true
to use Pria programmatically without the visual interfaceThe button is positioned at fixed position on the bottom right by default. You can change the position by using CSS expressions like
buttonPositionRight: 'calc(50% - 40px)'
to center the button on the screenInstance Configuration
Configure which Digital Twin to use in theinstanceConfig
object
The publicId specifies which digital twin to initialize on the page
For enhanced security, always retrieve these values asynchronously from a secure source to prevent exposure of plaintext data in the page.
User identity
Set the user identity in theuserConfig
object
The email field is required and is the primary user identification methid in Praxis AI Middleware
Education Use Case: Use the
roleid
and rolename
to specify a Course information (ID and Name)Use
partnerid
and partnername
to identify an Account or Customer when you create a multi tenant solutionFor enhanced security, always retrieve these values asynchronously from a secure source to prevent exposure of plaintext data in the page.
Integration Class Sample
This example is provided AS IS to demonstrate how you can cleanly integrate a Digital Twin in your Web Application. It is extracted from the playground example code.SDK Playground Example
You can take a look at a running example at SDK Playground Example.