Customizing the Sidekick
You can customize the sidekick for your project. You can add a /tools/sidekick/config.json
configuration file to your project’s GitHub repository:
For all available configuration options, see the Sidekick API documentation or the config schema. Here are some basics to get started:
Plugins
id
andtitle
are mandatory.title
will show up on the plugin button. You can provide localized titles in atitleI18n
object- How to specify the plugin action depends on the intent:
- To simply open a URL in a new window, you can use the
url
property. You can optionally have it open in a palette by settingisPalette
totrue
./tools/sidekick/config.json
:\
- To simply open a URL in a new window, you can use the
- Executing code must be done in the context of your page (not supported in the edit and admin environment). You can use the
event
property to specify the name of an event to be fired when the plugin button gets clicked. You can then react to it in your application code as in the following example:/tools/sidekick/config.json
:\
- The
environments
array specifies where the plugin should appear (dev, edit, admin, preview, live, or prod). You can also defineexclude_paths
andinclude_paths
arrays to narrow down the plugin’s appearance based on the path. isContainer
turns a plugin into a dropdown. You can then add other plugins to it by specifying its ID in thecontainerId
property.override
can be set totrue
to extend an existing plugin.
Special Views
path
andviewer
are mandatory. Optionally, you can specify atitle
that will be shown at the top, and you can provide localized titles in atitleI18n
object:\
- Add an HTML file as configured in
path
to your project’s GitHub repository:\
- Add an optional CSS file in the same directory, and a JS file with your logic:\
- Open a project URL that matches the configured
path
and click the sidekick to see your viewer in action.
recommendation-more-help
10a6ce9d-c5c5-48d9-8ce1-9797d2f0f3ec