Jwt token for google

hello

i am using googleapis lib on selfhost n8n and it works just fine.

but i cannot use it on cloud instance. so i asked gpt to write js function but it did not work…

can anybody suggest a solution?

const jwtClient = new google.auth.JWT(
  'xxxxxxxx.gserviceaccount.com',
  null,
  privateKey,
  ['https://www.googleapis.com/auth/firebase.messaging']
);

so i need this to work on cloud.

thanks

cani use jwt node?

If the workflow node where you need the JWT Authorization header can use an OAuth2 credentials item, with Grant Type: Client Credentials, you might be able to use the same adapter/workaround posted here.

The JWT node is meant to support the server-end of a JWT interaction, for when you want to use/require JWT on something calling into an n8n webhook (e.g. to create a pseudo-session). It’s not for the client end of JWT.