Skip to main content

addMetadata(key, value, addToUserProperties?)

Adds metadata to CommandBar.

Example

window.CommandBar.addMetadata("userIsWorkspaceOwner", true);

Method parameters

key Required

string

The key for the metadata. Used to reference it in other places, e.g., Command Rules.

value Required

any

There are two options:

  • Value: A literal value (e.g. true)
  • Dynamic: A function to load a value for key, used to lazily load a metadata value. Dynamic values are refreshed on page load and on Bar open.