My expertise in the area of client-side webapp development is limited. From what I can fathom I’d say:
- Use buttons for cases where you want the user to stay on the same page. Tie the backend API call to the button click event (it sounds like you’re already doing something like this).
- For situations where the user should be sent to a different page, use a form submission followed by a server-side redirect upon success?
In any case I won’t recommend injecting ID tokens into hyperlinks. It just results in all sorts of weirdness. If the user leaves a page open for a while, the ID tokens will expire, and all the links will become invalid.
I’d also recommend you to ask around in Stackoverflow. Your question will receive more visibility, and hopefully somebody knows this area better than me can help you out. Good luck!