# The code editor

Each integration has a built-in **Code Editor** (powered by Monaco, the same editor as VS Code) where you write the JavaScript that transforms an incoming webhook into a push message.

## The toolbar

Across the top of the editor you'll find:

| Control               | What it does                                                                                                                              |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **Revision selector** | Switch between saved versions of your code, or "Not saved yet".                                                                           |
| **Save**              | Store the current code as a new [revision](/introduction/justpush-studio/revisions/revisions.md).                                         |
| **Test**              | Open the [test runner](/introduction/justpush-studio/testing-and-monitoring/testing-your-code.md) to try your code with a sample request. |

## Writing code

* The editor is **JavaScript** with syntax highlighting, autocomplete, and error squiggles.
* It follows your Studio theme — light or dark — automatically.
* Your code's job is simple: **read the incoming request and return a message**. See [Execution model](/introduction/justpush-studio/writing-code/execution-model.md).

## The "Not saved yet" state

As soon as you change the code, the revision selector shows **Not saved yet**. Your edits are live in the editor but **not stored** until you click **Save**. Switching away or reloading before saving will lose unsaved changes.

{% hint style="info" %}
Saving creates a new revision rather than overwriting the old one, so you can always roll back. See [Working with revisions](/introduction/justpush-studio/revisions/revisions.md).
{% endhint %}

## Recommended workflow

1. Write or edit your transformation.
2. **Test** it with a representative payload.
3. **Save** once it behaves.
4. Send a real event and confirm it in [Request history](/introduction/justpush-studio/testing-and-monitoring/request-history.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.justpush.io/introduction/justpush-studio/writing-code/the-code-editor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
