Company logo
April 23, 2021

New and improved CommandBar.boot

Vinay Ayyala's avatar

There are two painpoints we are addressing with our new CommandBar.boot SDK method:

  1. Confusion over how to pass in the user ID
  2. Enable you to pass in more information about the user in event data for more useful analytics (previously all you got was the user ID)

The new CommandBar.boot takes two arguments:

  1. id (string, required)
  2. eventData (object, optional)

To illustrate what this means, let's dig into the following example:

window.CommandBar.boot(loggedInUserId, {company: companyName, subscription: subscriptionType});

In the example above, we pass in a userId (as always), but we also use the second argument to pass an object with key-value pairs that will be attached to reported CommandBar events.

Let's say Michael Scott from Dunder Mifflin has an Enterprise subscription and executes a command. Here's what we'd be able to see in his command execution data:

  • Michael Scott's user ID ("WorldsBestBoss")
  • Michael Scott's company name ("Dunder Mifflin")
  • Michael Scott's subscription type ("Enterprise")

For more details:

How can I turn this on? 🛠

No existing calls to boot will break with this change. If you want to take advantage of the improvements, just edit your CommandBar.boot calls.