How to install a Roam plugin

Roam plugins are snippets of JavaScript code that extend Roam’s set of features. Below, you find instructions how to set up the plugin page and add new plugins.

Step 1: Create roam/js page

From any page in Roam, create a page titled roam/js by typing [[roam/js]].  

Step 2: Enable JavaScript on roam/js page

Click the link so you’re on the roam/js page. There, enable JavaScript by typing {{[[roam/js]]}}:

roam/js page  

Step 3: Create a code block below the JavaScript block

Hit Enter and then Tab to create a child block under the JavaScript block. Now, we’re going to add a code editor. In the new block, type /code and select the Code Block option from the trigger menu. Alternatively, type six backticks (````````).

Roam code block via trigger


Roam code block via shortcode

Next, click outside the block to show the code editor and set the language to JavaScript via the dropdown:

Roam codeblock set to JavaScript

Step 4: Add plugin to code block

Copy the JavaScript code from the plugin’s website and paste it in the code block.  

Step 5: Enable JavaScript

Now that everything is ready, click the Roam JavaScript activation button button to activate the plugin. The block becomes yellow, indicating the code is being used by Roam:

Roam plugin active message


Was this helpful?