{
  "slug": "actions-commandbar",
  "name": "CommandBar",
  "mode": "device",
  "authentication": {
    "scheme": "custom",
    "fields": {
      "orgId": {
        "label": "Organization ID",
        "description": "The ID of your CommandBar organization.",
        "type": "string",
        "required": true,
        "multiple": false,
        "choices": null,
        "default": null,
        "depends_on": null
      },
      "deploy": {
        "label": "Deploy via Segment",
        "description": "If enabled, CommandBar will be deployed to your site automatically and you can remove the snippet from your source code.",
        "type": "boolean",
        "required": false,
        "multiple": false,
        "choices": null,
        "default": null,
        "depends_on": null
      }
    }
  },
  "audienceConfig": null,
  "actions": {
    "identifyUser": {
      "title": "Identify User",
      "description": "Set attributes for the user in CommandBar. If \"Deploy via Segment\" is enabled, then also boot CommandBar for the user, which makes CommandBar available to the user.",
      "platform": "web",
      "defaultSubscription": "type = \"identify\"",
      "hidden": false,
      "hasPerformBatch": false,
      "syncMode": null,
      "hooks": null,
      "dynamicFields": null,
      "fields": {
        "userId": {
          "label": "User ID",
          "description": "The user's id",
          "type": "string",
          "required": true,
          "multiple": false,
          "allowNull": false,
          "dynamic": false,
          "default": {
            "@path": "$.userId"
          },
          "choices": null,
          "placeholder": null,
          "properties": null,
          "category": null,
          "depends_on": null,
          "readOnly": null,
          "hidden": null,
          "minimum": null,
          "maximum": null,
          "defaultObjectUI": null,
          "disabledInputMethods": null,
          "displayMode": null,
          "format": null,
          "additionalProperties": false
        },
        "hmac": {
          "label": "HMAC",
          "description": "Identify users with an HMAC of their user ID; this enables end user customizable shortcuts and other features. [Learn about identity verification](https://app.commandbar.com/identity-verification).",
          "type": "string",
          "required": false,
          "multiple": false,
          "allowNull": false,
          "dynamic": false,
          "default": {
            "@path": "$.context.CommandBar.hmac"
          },
          "choices": null,
          "placeholder": null,
          "properties": null,
          "category": null,
          "depends_on": null,
          "readOnly": null,
          "hidden": null,
          "minimum": null,
          "maximum": null,
          "defaultObjectUI": null,
          "disabledInputMethods": null,
          "displayMode": null,
          "format": null,
          "additionalProperties": false
        },
        "formFactor": {
          "label": "Event Metadata",
          "description": "Configures the way the bar is displayed. An 'inline' bar is always visible and hosted within an element on your page. A 'modal' bar will display in a modal dialog when open.",
          "type": "object",
          "required": false,
          "multiple": false,
          "allowNull": false,
          "dynamic": false,
          "default": {
            "@path": "$.context.CommandBar.formFactor"
          },
          "choices": null,
          "placeholder": null,
          "properties": null,
          "category": null,
          "depends_on": null,
          "readOnly": null,
          "hidden": null,
          "minimum": null,
          "maximum": null,
          "defaultObjectUI": null,
          "disabledInputMethods": null,
          "displayMode": null,
          "format": null,
          "additionalProperties": false
        },
        "traits": {
          "label": "Traits",
          "description": "The Segment traits to be forwarded to CommandBar",
          "type": "object",
          "required": false,
          "multiple": false,
          "allowNull": false,
          "dynamic": false,
          "default": {
            "@path": "$.traits"
          },
          "choices": null,
          "placeholder": null,
          "properties": null,
          "category": null,
          "depends_on": null,
          "readOnly": null,
          "hidden": null,
          "minimum": null,
          "maximum": null,
          "defaultObjectUI": null,
          "disabledInputMethods": null,
          "displayMode": null,
          "format": null,
          "additionalProperties": false
        }
      }
    },
    "trackEvent": {
      "title": "Track Event",
      "description": "Submit an event's properties as CommandBar metaData.",
      "platform": "web",
      "defaultSubscription": "type = \"track\"",
      "hidden": false,
      "hasPerformBatch": false,
      "syncMode": null,
      "hooks": null,
      "dynamicFields": null,
      "fields": {
        "event_name": {
          "label": "Event Name",
          "description": "The name of the event.",
          "type": "string",
          "required": true,
          "multiple": false,
          "allowNull": false,
          "dynamic": false,
          "default": {
            "@path": "$.event"
          },
          "choices": null,
          "placeholder": null,
          "properties": null,
          "category": null,
          "depends_on": null,
          "readOnly": null,
          "hidden": null,
          "minimum": null,
          "maximum": null,
          "defaultObjectUI": null,
          "disabledInputMethods": null,
          "displayMode": null,
          "format": null,
          "additionalProperties": false
        },
        "event_metadata": {
          "label": "Event Metadata",
          "description": "Optional metadata describing the event.",
          "type": "object",
          "required": false,
          "multiple": false,
          "allowNull": false,
          "dynamic": false,
          "default": {
            "@path": "$.properties"
          },
          "choices": null,
          "placeholder": null,
          "properties": null,
          "category": null,
          "depends_on": null,
          "readOnly": null,
          "hidden": null,
          "minimum": null,
          "maximum": null,
          "defaultObjectUI": null,
          "disabledInputMethods": null,
          "displayMode": null,
          "format": null,
          "additionalProperties": false
        }
      }
    }
  },
  "presets": [
    {
      "name": "Track Event",
      "type": "automatic",
      "partnerAction": "trackEvent",
      "subscribe": "type = \"track\"",
      "mapping": {
        "event_name": {
          "@path": "$.event"
        },
        "event_metadata": {
          "@path": "$.properties"
        }
      },
      "eventSlug": null
    },
    {
      "name": "Identify User",
      "type": "automatic",
      "partnerAction": "identifyUser",
      "subscribe": "type = \"identify\"",
      "mapping": {
        "userId": {
          "@path": "$.userId"
        },
        "hmac": {
          "@path": "$.context.CommandBar.hmac"
        },
        "formFactor": {
          "@path": "$.context.CommandBar.formFactor"
        },
        "traits": {
          "@path": "$.traits"
        }
      },
      "eventSlug": null
    }
  ]
}
