Usage reporting plugin; authenticating without environment variables

On the Apollo server, we are using the Usage Reporting Plugin. Our Sveltekit backend is currently running in a node.js environment, but we are slowly but steadily migrating away from using specific Node.js features because we plan on running on the edge.

Currently we authenticate the usage reporting plugin, by setting 2 environment variables APOLLO_KEY and APOLLO_GRAPH_REF. Is it possible to authenticate the plugin in another way?

Thanks in advance :pray:

You can pass the apollo constructor option to your ApolloServer instance.

It’s worth mentioning that supporting non-node environments in the Apollo Server project is desired, but we’re not there yet. I’ve done some exploration there but the work hasn’t been prioritized. If this is interesting enough for you to take on, I’d welcome a contribution from the community. My thoughts so far are captured in the related issue.

1 Like

Hi @trevor.scheer - thanks for providing the link, seems to work :+1:

Our plan at 21RISK is to migrate towards vercel edge function in Q1 2025, so we might take up the challenge :sweat_smile:

One of the key features we actually really like about Apollo is the usage reporting, we :heart: the Apollo studio so really hope we can make it work when the time comes (we are also working for the people at MongoDB to support/develop a native TCP-like drive).

1 Like

Great! Feel free to ping me on that issue if you decide to take it on. I’m happy to provide guidance and review a PR.