> For the complete documentation index, see [llms.txt](https://shinyobjectlabs.gitbook.io/fetch-js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shinyobjectlabs.gitbook.io/fetch-js/javascript-api/callbacks.md). Agents can also search and read this documentation through its [MCP server](https://shinyobjectlabs.gitbook.io/fetch-js/~gitbook/mcp).

# Callbacks

### Overview

All SO-Fetch events support callbacks, which are executed when the event occurs. This allows users to hook into 3rd party JavaScript libraries and inject/ transform request options.

### Events

{% content-ref url="/pages/5aB1Lw486gg0THLa5gs5" %}
[onRequestInit](https://shinyobjectlabs.gitbook.io/fetch-js/javascript-api/callbacks/onrequestinit.md)
{% endcontent-ref %}

{% content-ref url="/pages/yXDBXainLSIFr4MSS7OF" %}
[onSuccess](https://shinyobjectlabs.gitbook.io/fetch-js/javascript-api/callbacks/onsuccess.md)
{% endcontent-ref %}

{% content-ref url="/pages/ZDNxBkTzHifgNYabCorU" %}
[onError](https://shinyobjectlabs.gitbook.io/fetch-js/javascript-api/callbacks/onerror.md)
{% endcontent-ref %}
