getRouterData( )

Returns the data that a router passed to the page in its response.


When you create a router and define its functionality in its router() function, you can choose to send data along with the router's response. That data is retrieved in the code of the page that was routed to using the getRouterData() function.

If you call the getRouterData() function from a non-router page or a router page that wasn't sent any data, the function returns null.



This endpoint does not take any parameters

Response Object

The data returned by the router.

Returns an empty object.

Status/Error Codes

Related Content:

Was this helpful?

Get the data passed by a router

Copy Code
1import wixWindow from 'wix-window';
3// ...
5let routerData = wixWindow.getRouterData();