How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • // Make a request to a protected Cloud Run service.
    const { GoogleAuth } = require("google-auth-library");
    
    async function main() {
      const url = "https://cloud-run-1234-uc.a.run.app";
      const auth = new GoogleAuth();
      const client = await auth.getIdTokenClient(url);
      const res = await client.request({ url });
      console.log(res.data);
    }
    
    main().catch(console.error);
    
    Docs
    0
  • // Make a request to a protected Cloud Identity-Aware Proxy (IAP) resource
    const {GoogleAuth} = require('google-auth-library');
    
    async function main()
      const targetAudience = 'iap-client-id';
      const url = 'https://iap-url.com';
      const auth = new GoogleAuth();
      const client = await auth.getIdTokenClient(targetAudience);
      const res = await client.request({url});
      console.log(res.data);
    }
    
    main().catch(console.error);
    Docs
    0
  • // Make a request to a protected Cloud Run service.
    const { GoogleAuth } = require("google-auth-library");
    
    async function main() {
      const url = "https://cloud-run-1234-uc.a.run.app";
      const auth = new GoogleAuth();
      const client = await auth.getIdTokenClient(url);
      const res = await client.request({ url });
      console.log(res.data);
    }
    
    main().catch(console.error);
    
    Docs
    0
  • // Make a request to a protected Cloud Identity-Aware Proxy (IAP) resource
    const {GoogleAuth} = require('google-auth-library');
    
    async function main()
      const targetAudience = 'iap-client-id';
      const url = 'https://iap-url.com';
      const auth = new GoogleAuth();
      const client = await auth.getIdTokenClient(targetAudience);
      const res = await client.request({url});
      console.log(res.data);
    }
    
    main().catch(console.error);
    Docs
    0
  • async function main() {
      const auth = new GoogleAuth({
        scopes:
          "https://www.googleapis.com/auth/cloud-platform",
      });
      const client = await auth.getClient();
      const projectId = await auth.getProjectId();
      // List all buckets in a project.
      const url = `https://storage.googleapis.com/storage/v1/b?project=${projectId}`;
      const res = await client.request({ url });
      console.log(res.data);
    }
    
    Docs
    0
  • const { GoogleAuth } = require("google-auth-library");
    
    /**
     * Instead of specifying the type of client you'd like to use (JWT, OAuth2, etc)
     * this library will automatically choose the right client based on the environment.
     */
    async function main() {
      const auth = new GoogleAuth({
        scopes:
          "https://www.googleapis.com/auth/cloud-platform",
      });
      const client = await auth.getClient();
      const projectId = await auth.getProjectId();
      const url = `https://dns.googleapis.com/dns/v1/projects/${projectId}`;
      const res = await client.request({ url });
      console.log(res.data);
    }
    
    main().catch(console.error);
    
    Docs
    0
  • const {
      ExternalAccountClient,
    } = require("google-auth-library");
    const jsonConfig = require("/path/to/config.json");
    
    async function main() {
      const client = ExternalAccountClient.fromJSON(jsonConfig);
      client.scopes = [
        "https://www.googleapis.com/auth/cloud-platform",
      ];
      // List all buckets in a project.
      const url = `https://storage.googleapis.com/storage/v1/b?project=${projectId}`;
      const res = await client.request({ url });
      console.log(res.data);
    }
    
    Docs
    0
  • const {
      ExternalAccountClient,
    } = require("google-auth-library");
    const jsonConfig = require("/path/to/config.json");
    
    async function main() {
      const client = ExternalAccountClient.fromJSON(jsonConfig);
      client.scopes = [
        "https://www.googleapis.com/auth/cloud-platform",
      ];
      // List all buckets in a project.
      const url = `https://storage.googleapis.com/storage/v1/b?project=${projectId}`;
      const res = await client.request({ url });
      console.log(res.data);
    }
    
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples