guage-TypeScript">import { graph } from &quot;@pnp/graph&quot;;
import &quot;@pnp/graph/users&quot;;
import { BearerTokenFetchClient } from &quot;@pnp/core&quot;;
import { myTokenFactory } from &quot;./my-auth.js&quot;;

graph.setup({
    graph: {
        fetchClientFactory: () =&gt; {

            // note this method is not async, so your logic here cannot await.
            // Please see the LambdaFetchClient if you have a need for async support.
            const token = myTokenFactory();
            ret