How to access the form key with a JavaScript inside the backend?

Use the FORM_KEY JavaScript constant:

The Magento_Backend::page/js/require_js.phtml template is included into each backend page:

Usage examples from the core



Another way

You can also use the form_key cookie similar to to the frontend way:

See also: