How to access Bindings inside custom functions of an RPC Worker?

I need to be able to access the
env
to be able to reference some vars or other CF services from the RPC worker, this worker will be called from another worker through Service Bindings

import { WorkerEntrypoint } from "cloudflare:workers";

export default class MyRPCWorker extends WorkerEntrypoint {
  async fetch(req: Request, env: Env) { console.log("env as the second argument is valid in the fetch handler"); }

  async customFunction(param1: string) { console.log("I need to access the env of the current RPC worker here when calling this method from another worker using Service Bindings...") }
}


I didn't find anything within docs nor other discussions
Was this page helpful?