Introduction
This documentation details the installation steps to set up a Praxis AI Instance into Canvas using the Canvas Theme Editor. When installed in the Theme, the Instance becomes embedded into Canvas’s pages.
Add a Praxis AI Instance to your Theme
To add a Praxis AI Instance globally to a Canvas account, you will upload a segment of JavaScript in the Theme used by the account or sub-account of your choice.Prerequisites - You must have administrative access to the Canvas account. -
Ensure you have the necessary permissions to edit the Theme. - Download the
SDK
Step 1. Download SDK
Step 1. Download SDK
pria-sdk-canvas.js
Download the pria-sdk-canvas.js code onto your computer, and save the file as pria-sdk-canvas.js
- We recommend storing this file in source control (GitHub, GitLab, etc.) so you can track changes to the file.
- You may also save this file into a Google Drive, and edit your customizations on an ongoing basis.
- Keep track of the version of the file and your own modification to ensure that you are using the latest and greatest.
- When you select this file to inject in your theme, Canvas uploads a copy into its own CDN therefore, you need to reload the files into Canvas after you make a change.
Step 2. Edit Canvas Theme and Upload SDK
Step 2. Edit Canvas Theme and Upload SDK
1
Navigate to Admin Settings
Ex: Praxis AI

2
Select Themes
Click on the current Theme to open the Theme Editor.

3
Open Theme Editor
Click on the “Edit” button to open the Theme Editor.

4
Upload Tab
Click to the Upload tab on the left.

Instructure: How to Upload Custom JavaScript and CSS Files
We follow instructions similar to those posted Instructure’s documentation on
how to upload custom JavaScript and CSS files to an account.
Customizing the SDK
In this step, you will customize the Javascript SDK you downloaded to specify what instance of Praxis AI to use. Edit the filepria-sdk-canvas.js from your download
Disabled by Default
If you prefer to disable Praxis AI by default set theINSTITUTION_ID to undefined
Require Teacher Onboarding
If you prefer to use the “Teacher Onboarding” process, leave theINSTITUTION_ID field blank (e.g. “”) like this:
Assign all to Praxis AI Instance
If prefer to assign everyone to the same Praxis AI instance (for the sub-account), then set the value of theINSTITUTION_ID to the instance public ID given to you by Praxis , ex: 5fd6d7a4-4cc7-4e04-8473-e89aef4e…
The value of the
INSTITUTION_ID field is unique to your instance of Pria.
Keep this ID confidential.Customize the Instance icon
You can change the icon of the button that will appear on the screen with the following variable: If you like to keep using Pria’s icon, leave theINSTITUTION_ICON_URL as undefined

- We recommend using a square image, no larger than 192 x 192 pixels, that also supports transparency (like PNG or webp format) - This image should be placed on a Content Delivery Network that allows access across origin or domains (CORS Policy)
Display Options
You can customize the position, size and container of the Instance’s button as well as the main window with the following JavascriptDISPLAY_OPTIONS variable:
| Option | Default / Allowed Values | Description | Notes |
|---|---|---|---|
| fullScreen | true | false (default) | Display Pria in fullscreen. | |
| openOnLoad | true | false (default) | Open Pria immediately on load or keep closed until user clicks the Pria button. | |
| buttonWidth | CSS width value | '80px' (default) | Size of the Pria button. | See CSS width examples. |
| buttonPosition | CSS position value | 'fixed' (default) | Position type of the button. Default is fixed, but can be relative or absolute. | |
| buttonPositionBottom | CSS bottom value | '20px' | Distance from the bottom edge of the screen (only applies to fixed or absolute position). | See CSS bottom examples. Example: calc(100% - 120px) to place icon at top. |
| buttonPositionRight | CSS right value | '20px' | Distance from the right edge of the screen (only applies to fixed or absolute position). | See CSS right examples. Example: calc(100% - 120px) to place icon at top. |
| buttonNoBounce | true (default) | false | Whether the button bounces when displayed. | Default: no bounce. |
| priaContainerId | Element ID | '' (BODY by default) | Parent element for Pria UI iFrame. | Empty value appends to <body>. |
| buttonContainerId | Element ID | '' (BODY by default) | Parent element for the Pria button. | Empty value appends to <body>. |
| allowPop | true | false (default) | Option to open Pria in a new tab. | Deprecated due to third-party cookie restrictions. |
loadPria() function.
the loadPria() function will not load Pria twice if it happens to be called
more than once.
loadPria() function is placed when the student or teacher is on a course page.
This determination is done using a regular expression with the function onPage() like below:
In Canvas, course pages have URLS that match this structure
https://my-univertivt.canvas.edu/courses/106/… and this is what we rely on to
determine to loadPria() so it loads only for courses.
Load for certain courses
It is common that administrator want to load a Instance only for certain courses, while it stays disabled for all the others. In this case, set the defaultINSTITUTION_PUBLIC_ID to undefined.
Insitution Specific Courses
79875, 72856, or 55621, then we set the INSTITUTION_ID to a specific instance, and customize the icon to our own URL
Teacher Specific Courses
Similarly, you may choose to enable the Instance (let teacher crete their own twins) for a specific set of courses. To do so, simply set theINSTITUION_ID to empty string like this:
Instance per Teacher
You can write Javascript code that selects a specific Praxis AI instance for each teacher courses for example:Useful Functions
The Javascript SDK has a lot of additional useful functions you can. Let’s take a look at those.hasAnyRole()
hasAnyRole()
The function hasAnyRole() determines if the current user has the specified role (ex:user, teacher, admin,root_admin)
isUser()
isUser()
The function isUser() determines if the current user is the one specified by id (ex: 1)
isInUsers()
isInUsers()
The isInUsers() function determines if the current user is in the array of specific user ids
isStudent()
isStudent()
The function isStudent() determines if the current user is a student
isCourse()
isCourse()
The function isCourse() determines if the current page is in a specific course (ex: id 123)
isInCourses()
isInCourses()
The function isInCourses() determines if the current course is in an array of specific courses
onElementRendered()
onElementRendered()
The onElementRendered() function is triggered when an element is fully displayed in the page
Example below is an anchor referenced by ID create_ticket.
The ENV variable
In Canvas, a Javascript object calledENV is available to any pages rendered in the Application.
When injected as a Theme, the Instance has access to the variable and uses it to determine who is the current user, or what course is he/she launching.
To review the properties made available by the ENV variable, open a course page in Canvas, and launch the Developer Mode (F12 on Windows - developer tools on Mac) then in the Console window, type ENV then press the ENTER key.
Here is an example of such variable:
-
current_userproperty -
current_user_rolesproperty: -
current_contextproperty:
Install the Instance SDK into Theme
Once you have customized your SDK Javascript file and added the logic to load the Instance when the proper conditions are met, you are ready to add it to your current Theme1
Upload JavaScript SDK
- In the Theme Editor, Upload Tab, under the JavaScript File section, click on the Select button
- Select the pria-sdk-canvas.js that you just customized from your download folder, then click OK
- The theme Editor will download the Javascript onto Canvas content delivery network so it becomes available to the theme.
2
Preview Changes
- Click on the Preview Your Changes button
- Verify that the Instance is running properly in Preview mode
- The Instance Icon should appear at the bottom of the screen in preview mode
- The Instance UI should open and connect upon click on the icon
- If the Instance appears properly in Preview mode, click the Save to apply the changes in the Theme and return to the Theme selector.
3
Confirm Praxis Loads
- The Instance Icon should display properly
- Congratulations, the Instance is now installed in your theme.
- To verify, login using a standard User account, and navigate to the section of Canvas where you are loading the Instance, example below in a course
Subaccounts
Canvas allows administrators to set up themes for sub accounts. Use this technique to enable Praxis AI in a Theme for specific user population/courses.
It is best practice to add Praxis AI only to sub accounts, because scripts are
added from Parent to Child domains.
Teacher Onboarding
This process happens IF you decide to leave the
INSTITUTION_ID field as an empty string (by default) in the SDK file inserted in the theme.The teacher (or any administrator) is then expected to Create an instance of Pria (a.k.a. Instance), or connect to an existing one for every course the teacher wants Pria in.Create your Digital Twin
- The onboarding wizard starts when the Teacher clicks on Pria’s icon to expand for the first time
- This wizard allows for the creation of an instance of Pria, dedicated to the teacher.


- a name for your twin, ex: Bob,
- a picture URL that is accessible on the internet (without CORS issues), and
- a picture to use for the ui background
- An A.I. prompt that personalizes your character (more information is available in the Faculty Guide )

Anytime you or your students will click on Pria in this page, you will access
this instance directly.

More Personalization Options
Personalization
More information on Admin functions is available in this documentation.

- Follow the instructions in the Admin Guide to setup integration to your Canvas instance and allow Pria to search your course content.
- If you are using Kaltura, this is a good time to configure the integration as well. Contact your IT Administrator
- Anytime you make a change to the instance, don’t forget to click the Update button to save your changes.