How to Interact with Service Workers from Pages Functions

Hi all,

I am building an Astro frontend Pages that will run its API code in a Functions directory, and I need to have it interact with another Cloudflare Worker that is another API that handles authentication.

This way I can decouple the Auth Worker as a microservice and have it interact with other Workers if needed. I made a simple diagram of this.

How would I go about binding the proper URL of this Auth worker in such a way that it is dynamically linked? I followed the advice here: https://docs.astro.build/en/guides/integrations-guide/cloudflare/#config

But this won't allow the binded Service Workers URL to get passed along into Astro's runtime; what is the recommended approach for this?

Thank you!
Was this page helpful?