## 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

1. Open the **Custom Scripts** module.
2. Create a script and choose the **surface** (dashboard, portal or widget).
3. Set the **type** (JS or CSS) and when it should run.
4. Use the **ctx** context provided by the runtime to interact with the surface safely.
5. 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.

## 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.

## See also

- [API & Developers overview](/hc/ajuda/articles/api-developers-overview-en)
- [Custom Scripts (Administration)](/hc/ajuda/articles/administration-custom-scripts-en)