Slapdash Platform
GitHub
  • Ahoy, world!
  • Command Bar 101
    • How it Works
    • Core Terminology
    • Commands
    • Local Commands
    • Cloud Commands
    • Build Your First Command
    • Publish Command
    • Hooks
  • Command Tutorials
    • Toggle Dark Mode
    • Emoji Paster
    • Copy Special Character
    • Send Slack Message
  • Reference
    • Command Response
    • Action
    • View
    • List View
    • Masonry View
    • Form View
    • Tokens
    • Icon
    • Config
Powered by GitBook
On this page
  • Config
  • Show Config Conditionally
  1. Reference

Config

PreviousIcon

Last updated 3 years ago

Config allows displaying a "one-time" form in the Command Bar. All values from this form will be securely stored on the server and sent to the command any time it is run. Useful when a command requires some configuration (e.g. API key) before it can be run.

To see a real example, check out the command.

Config

{
  "config": {
    "form": {
      "fields": [
        {
          "type": "text",
          "id": "api-key",
          "label": "API Key",
          "placeholder": "GIPHY API key"
        }
      ]
    }
  }
}
{
  "config": {
    "form": {
      "error": "This API Key has expired",
      "fields": [
        {
          "type": "text",
          "id": "api-key",
          "label": "API Key",
          "placeholder": "GIPHY API key"
        }
      ]
    }
  }
}

Show Config Conditionally

You will likely want to show the configuration form to the user conditionally, e.g. when the user hasn't entered the values yet or when the values are incorrect. See the on how to do it.

Send Slack Message
Send Slack Message