[ARCHIVED] Can we build and distribute canvas internal plugins?

Jump to solution
zia_rehman
Community Novice

Is there some official way to build Canvas's internal plugins? By internal plugins I mean plugins which will hook directly into canvas's codebase, and hence will have whole lot more power. Like some official plugins provided by canvas which i believe reside here: canvas-lms/gems/plugins at master · instructure/canvas-lms · GitHub 

We are building some plugins for one of our not-for-profit products, and we would like it to do some functionalities in canvas which are not possible with APIs and LTI. We have built one such plugin for moodle, moodle allows for such plug-gable plugins. It doesn't seem so Canvas allows such plugins, but i still wanted to confirm what are our options(if any).

NOTE: We are not building this plugin for internal use, we have to distribute it, so it can't be that all of our users go in their code-base and manually add these plugins, we are looking for some practical way of distributing such plugins, like LTI apps are distributed.

Labels (2)
1 Solution
James
Community Champion

 @zia_rehman ,

There are three ways to get your code to interact with Canvas at a deeper level than what is provided by API and LTI.

  1. Get your code into the actual Canvas code that is executing. The first way is to sign the agreements and become a code contributor. This would get it into every Canvas instance, not just for your customers. If your code is not consistent with the Canvas philosophy, then the pull request won't be accepted. The second way here is to self-host Canvas and then you can add whatever you need to into the code. This is where some of the gems you referenced come in, but you will not be able to do this if Instructure hosts the Canvas for the institution.
  2. You can get Canvas Administrators to add custom JavaScript through their theme editor. This is the Canvas-preferred solution for software that needs to integrate at the level described. This is a manual process since you are only allowed one JavaScript file per (sub)account and they will need to merge it with any other code that exists. You may consider providing them a short JavaScript script that loads the main script from your site, otherwise there no easy upgrade path for your software. Others will require all of the code so they can see what you're doing. This will affect all users for any institution who installs it, so make sure you have high quality code that doesn't load on pages where it doesn't need to load. Also make sure it doesn't break Canvas.
  3. Individual users can use a userscript manager browser extension like Tampermonkey on their own computer in their own browser. This then injects JavaScript into the page like it was a part of the original page. This is the easiest to install for small numbers of users. I have done this a lot. However, some people may not want to install the extension and it now costs a small amount for Safari. Another approach here is to create your own custom browser extension and have people install it.

Canvas really doesn't want you doing any of those. In 2013, one of the company founders introduced me to some developers that were all about the custom JavaScript approach, but Canvas has shifted focus since then and they really want plugins to use the LTI framework. Some sites integrate at such a level that they have to go through Custom JavaScript. When that happens, I normally complain to my local Canvas administrator about the error messages I'm seeing show up in the browser developer tools because of poor coding.

View solution in original post