How to access context variables in Jira addon?

I’m a bit confused about how to access context variables (specifically project.id, to see which project page the addon is being accessed from) within a Jira addon app. I want to use the project id to make sure I display the right data on the page corresponding to the specific project.

I’ve read this doc on context variables but am confused on what is meant. I haven’t been able to find any REST endpoints that use project ID so I’m confused by what should be supplied as the url. Thanks for bearing with an atlassian rookie here!