Next.js Discord

Discord Forum

URL with # instead of query string

Answered
Havana posted this in #help-forum
Open in Discord
HavanaOP
I've got a 3rd party (Supabase) hitting my site with a # url rather than a query string. In a route handler how can I access the values that are being set on the hash as I'm not seeing anything in the docs and none of my own URL debugging seems to turn up the values?

Thank you
Answered by joulev
url fragments (hashes) are not sent to the server, so you have to access it in the browser
View full answer

3 Replies

Answer
so it cannot be a route handler but a page, in which you use a client component to read the hash and do whatever you need with it
HavanaOP
Thanks @joulev I've done precisely that, parsing it with a client component and sending it back to an API