• /
  • EnglishEspañolFrançais日本語한국어Português
  • Log inStart now

end (SPA API)

Syntax

newrelic.interaction().end()

Ends the SPA interaction at the current time.

Requirements

Description

This SPA method will end the browser interaction at the current time. Any subsequent network requests that begin after this method is called will not be included as part of the current SPA interaction. In SPA v2.1 and later, this method can also be used to terminate an interaction in a pending state that monitors for any long task in a 5-second window.

Return values

This method returns the same API object created by interaction().

Examples

router.addRoute('/profile', () => {
startSlowBackgroundAjax(); // Start work that will continue past the end of the interaction
renderProfileComponents().then(() => { // Do work that is part of the interaction
newrelic.interaction().end(); // End the interaction once the important components an the page have finished rendering
});
});
Copyright © 2025 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.