# CommandBar

[CommandBar](https://www.commandbar.com/) is an AI-powered user assistance platform. It allows product, marketing, and customer success teams achieve their user engagement, activation, conversion, and retention goals.

Find the open source code for this destination in the [GitHub repository](https://github.com/rudderlabs/rudder-sdk-js/tree/develop/packages/analytics-js-integrations/src/integrations/CommandBar).

## Setup

1. In your [RudderStack dashboard](https://app.rudderstack.com/), go to **Directory** > **Destinations** > **Cloud Destinations**  and search for **CommandBar**.
2. Connect your source and click **Continue**.

### Connection settings

Configure the following settings to set up CommandBar as a destination in RudderStack:

- **Name**: Assign a name to uniquely identify the destination.
- **Organization ID**: Enter your [CommandBar organization ID](#faq). You can find it in the left navigation bar of your CommandBar dashboard by clicking your organization name. 

### Connection mode

{{< destination-config >}}

## Get started

{{< info >}}
In the web device mode integration, that is, using [JavaScript SDK]({{< ref "sources/event-streams/sdks/rudderstack-javascript-sdk/_index.md" >}}) as a source, RudderStack loads the CommandBar snippet from the `https://*.commandbar.com` domain. Based on your website's content security policy, you might need to [allowlist this domain]({{< ref "sources/event-streams/sdks/rudderstack-javascript-sdk/load-js-sdk.md#allowlist-destination-domain" >}}) for the integration to work correctly.

For more information, see [setting up content security policies for CommandBar](https://www.commandbar.com/docs/guides/developer-docs/dealing-with-content-security-policies/#setting-up-content-security-policies-for-commandbar).
{{< /info >}}

### Configuration settings

- **Client-side Events Filtering**: This setting lets you specify which events should be blocked or allowed to flow through to CommandBar. For more information on this setting, see [Client-side Events Filtering]({{< ref "sources/event-streams/sdks/event-filtering.md" >}}).
- **Consent management settings**: Configure the consent management settings for the specified source by choosing the **Consent management provider** from the dropdown and entering the relevant consent category IDs. See [Consent Management in RudderStack]({{< ref "data-governance/consent-management/overview.md" >}}) for more information on this feature.

## Identify

You can use the [`identify`]({{< ref "event-spec/standard-events/identify.md" >}}) call to identify users in CommandBar. RudderStack maps this event to CommandBar SDK's [`boot`](https://www.commandbar.com/docs/sdk/lifecycle/boot/) method.

A sample `identify` call is shown:

```javascript
rudderanalytics.identify("1hKOmRA4GRlm", {
  name: "Alex Keener",
  address: "1800 Blue Gum Street",
  hmac: "hmacUserId",
  createdAt: "Mon May 19 2019 18:34:24 GMT+0000 (UTC)",
})
```

### Traits mapping

RudderStack maps the following `identify` traits to the CommandBar attributes:

| RudderStack property | CommandBar property | Data type |
| :---- | :----| :-----|
| `userId` <br /> <span style="color: #4D4DFF;font-size:12px;">Required</span>   | `userId` | String |
| `context.traits` + `traits` <br /> <span style="color: #4D4DFF;font-size:12px;">Default: `{}`</span> | `traits` | Object |
| `context.traits.hmacId` <br /> `traits.hmacId` | `Commandbar.hmac` | String | 

`hmacId` is used to identify users with an HMAC of their user ID, helping secure user-related features like customizable shortcuts. See [CommandBar identity verification](https://app.commandbar.com/identity-verification) for more information.

## Track

You can use the event names in your [`track`]({{< ref "event-spec/standard-events/track.md" >}}) calls to trigger surveys in CommandBar. RudderStack maps this event to CommandBar SDK's [`trackEvent`](https://www.commandbar.com/docs/sdk/events/trackevent/) method.

A sample `track` call is shown:

```javascript
rudderanalytics.track("User Signed Up", {});
```

## FAQ

#### **Where can I find the CommandBar organization ID?**

1. Log in to your [CommandBar dashboard](https://app.commandbar.com/login).
2. In the left navigation bar, click your organization name at the bottom and copy the **Org ID**.

{{< image src="images/event-stream-destinations/commandbar-org-id.webp" alt="CommandBar organization ID" >}}


