Roam Research Docs · Developer documentation
onload and onunload functions
onload should be removed in onunload.
onload receives an object with the Roam Depot/Extension API in it
export default {
onload: ({extensionAPI}) => {},
onunload: () => {}
};
rm- in front of all our css classes, rm-modal
import from the window object to make it easier to import global dependencies
react
18.2.0
window.React
react-dom
18.2.0
window.ReactDOM
@blueprintjs/core
^3.50.4
window.Blueprint.Core
@blueprintjs/select
^3.18.6
window.Blueprint.Select
@blueprintjs/datetime
^3.23.14
window.Blueprint.DateTime
chrono-node
^2.3.2
window.ChronoNode
idb
7.1.1
window.idb
nanoid
^2.0.4
window.Nanoid
file-saver
^2.0.2
window.FileSaver
crypto-js
^3.1.9-1
window.CryptoJS
tslib
2.2.0
TSLib
marked-react
^1.1.2
RoamLazy.MarkedReact
marked
4.3.0
RoamLazy.Marked
jszip
^3.10.0
RoamLazy.JSZip
cytoscape
^3.7.2
RoamLazy.Cytoscape
insect.js
5.6.0
RoamLazy.Insect
extension.js / extension.css
control-d control-r, which will call your extension's unload function, load the new code, and call onload
unload then you can reload the page and hit control-d control-r to completely clear the state
build.sh file
build.sh file will be invoked before looking for extension.js (required) or extension.css (optional)
extensions/tonsky/roam-calculator.json
{
"name": "Test Extension 1",
"short_description": "Prints 'Test message 1'",
"author": "Nikita Prokopov",
"tags": ["print", "test"], //optional
"source_url": "https://github.com/tonsky/roam-calculator",
"source_repo": "https://github.com/tonsky/roam-calculator.git",
"source_commit": "d5ecd16363975b2e7a097d46e5f411c95e16682d",
"stripe_account": "acct_1LGASrQVCl6NYjck" // optional only include if you want to be eligible for payouts from Roam
}
digitalmaster+roam-memo+668 is the PR-shorthand for PR 668, and is mentioned in this github comment on the PR: https://github.com/Roam-Research/roam-depot/pull/668#issuecomment-1524315888
username + “+” + extension-id + “+” + pr-number
README.md and extension.js to the url leads to the required files
https://roam-excalidraw-depot.pages.dev/
/excalidraw instead
https://
main branch in your github repo (in case you want a persistent link or don't want to have to create a PR in roam-depot before further testing)
markdown version · view in Roam Research · exported 2026-07-03