Advanced : using event hooks

Attaching listeners to these events can allow automation of operations/workflows

Extension events

Event name

Triggered when...

Returns

zotero-roam:ready

Extension setup has completed

The extension's data store

zotero-roam:menu-ready

A page menu has finished rendering

  • The page's title

  • The page's UID

  • The Zotero item's DOI

  • The Zotero item's full metadata

  • The Zotero item's children

  • The Zotero item's Semantic Scholar citation data

  • The menu's HTML Element

  • The menu context (main view or sidebar)

zotero-roam:metadata-added

Metadata has been added to an item's page

  • The outcome of the operation (success ?)

  • The page's UID

  • The page's title

  • The Zotero item's full metadata

  • The blocks that the extension attempted to add

zotero-roam:notes-added

Notes have been added to an item's page

  • The outcome of the operation (success ?)

  • The page's UID

  • The page's title

  • The Zotero item's full metadata

  • The notes that the extension attempted to add

zotero-roam:update

A data update request has completed

  • The outcome of the update (success ?)

  • The requests that were sent

  • The data returned

zotero-roam:write

A write request to Zotero has completed

  • The target library

  • The target collection(s)

  • The item(s)' identifier(s)

  • The tags

  • The outcome of the operation (success ?)

  • The context of the import (cited/citing paper)

Detail of the events

The data returned for an event ev can be accessed through ev.detail.

See below for what is returned under different scenarios :

zotero-roam:ready

{
    items: [{...}], // The Zotero items requested
    libraries: [{...}], // The Zotero libraries requested
    keys: [{...}], // The Zotero API key(s) indicated, with their permissions
    collections: [{...}], // The collections for the Zotero libraries requested
    semantic: [],
    roamPages: []
}

zotero-roam:menu-ready

zotero-roam:metadata-added

zotero-roam:notes-added

zotero-roam:update

zotero-roam:write

Last updated

Was this helpful?