Thanks a lot, @fefrei. Your advice about the Rails console incited me to look deeper into the category descriptor for a topic_id field. And I found… a topic_url field! Getting the topic_id is then just a matter of:
const topic_id = parseInt(topic_url.split('/').pop())
Thanks again!