Jupyter-server extension to modify GatewayClient state

I’m trying to understand how jupyter-server extensions plug into the server. Is there a way to modify state in a jupyter-server from an extension running on that server? For example, I’d like to make an extension that adds a simple endpoint that, when called, updates the auth token within gatewayClient here. I understand how to write an extension that has a new endpoint, but I can’t figure out how to reference instantiated objects in jupyter-server within the context of the extension. Thanks in advance!