Overview
Custom Scripts let you inject JavaScript/CSS into specific platform surfaces β the dashboard, the Help Center portal and the chat widget. They're useful for small behavior and style customizations without changing the codebase.
Prerequisites
- Administrator permission to manage Custom Scripts.
- JavaScript/CSS knowledge.
Step by step
- Open the Custom Scripts module.
- Create a script and choose the surface (dashboard, portal or widget).
- Set the type (JS or CSS) and when it should run.
- Use the ctx context provided by the runtime to interact with the surface safely.
- Implement teardown to clean up what the script created, when applicable.
Settings & options
- Surface: dashboard / portal / widget.
- Type: JS or CSS.
- Execution: rules for when the script runs.
- Settings (
ctx.settings): they are the configuration defined by the operator and are meant for reading only. Each run of the script receives its own copy, which lasts only for that run. A change the script makes to that copy is not kept for the next run and does not modify the saved configuration. To keep state, usectx.storageon the surfaces that offer it: the dashboard, the portal and the widget. The public login, signup and password-reset pages do not offerctx.storage.
Use cases
- Add a button or notice on a specific screen.
- Tweak targeted styles of a surface.
- Log usage events for internal analysis.
Tips, limits & best practices
- Write idempotent scripts with teardown to avoid duplication.
- Avoid heavy dependencies; prefer lean code.
- Test in a controlled environment before publishing.
Troubleshooting
- Script doesn't run: confirm the surface and execution rules.
- Duplicated behavior: check teardown and idempotency.