Get current preview URI for use in API data source

What are you trying to accomplish
I want to use the current preview URI in a API data source, so that requests for the data are sent to middleware running on the web server.

Screenshots or video link
Something like this:

Hi @rjakes,

Does using the Custom Targeting in builder helps?

You may also find help in our blog post Using Query Params and Cookies in Next.js Static Pages

Hi @rjakes,

You can also access the current preview URI using the builder state.location object