
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
google-dwd
Advanced tools
Google Domain Wide Delegation Client for Node.js
This library enables Domain-Wide Delegation (DWD) using Service Account credentials without requiring a local private key file. It supports:
GOOGLE_APPLICATION_CREDENTIALS)It solves the limitation where standard Google libraries require a local private key for DWD, enabling secure, keyless operation in environments like Cloud Run or GKE.
npm install google-dwd
const { GoogleAuth } = require('google-auth-library');
const dwd = require('google-dwd');
async function main() {
// 1. Obtain the initial client (Must be a Service Account, Compute, or Impersonated client)
const auth = new GoogleAuth({
scopes: ['https://www.googleapis.com/auth/cloud-platform']
});
const client = await auth.getClient();
// 2. Exchange it for a DWD client acting as a specific user
const dwdClient = await dwd(
client,
'user@googleworkspace.com', // The user to impersonate
['https://www.googleapis.com/auth/gmail.readonly'] // Scopes required for the user
);
// 3. Use the new client to make requests
const res = await dwdClient.request({ url: 'https://gmail.googleapis.com/gmail/v1/users/me/profile' });
console.log(res.data);
}
main().catch(console.error);
The client passed to google-dwd must be an instance of one of the following classes from google-auth-library:
JWT (Standard Service Account key file)Compute (Environment-provided credentials on GCE/Cloud Run)Impersonated (Short-lived credentials created via IAMCredentials API)Note: User credentials (e.g., from gcloud auth application-default login) cannot be used directly. However, you can use them to create an Impersonated client (acting as a Service Account), which is supported.
FAQs
Google Domain Wide Delegation Client
We found that google-dwd demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.