npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

google-ads-kit

v0.1.2

Published

REST-first TypeScript SDK for the Google Ads API by Fullrun. No gRPC, no native bindings — works everywhere.

Readme

google-ads-kit

REST-first TypeScript SDK for the Google Ads API. No gRPC, no native bindings — works in Node.js, Deno, Bun, and edge runtimes.

Built by Fullrun — the AI-powered Google Ads platform. Extracted from the same codebase that manages real ad accounts in production.

Want Google Ads on autopilot? Fullrun uses google-ads-kit under the hood to run an AI agent that manages your Google Ads campaigns — keyword optimization, bid management, ad creation, and more. No code required.

Why?

Google has no official Node.js SDK for the Google Ads API. The community alternatives rely on gRPC, which breaks in serverless/edge environments and adds heavy native dependencies. google-ads-kit uses the REST API directly with built-in fetch — zero native deps, works everywhere.

We built this at Fullrun because we needed a Google Ads SDK that worked reliably in serverless environments. After running it in production for months, we decided to open-source it.

Install

npm install google-ads-kit

Quick Start

import { GoogleAdsClient, campaigns, query, toMicros } from "google-ads-kit";

const client = new GoogleAdsClient({
  clientId: process.env.GOOGLE_ADS_CLIENT_ID,
  clientSecret: process.env.GOOGLE_ADS_CLIENT_SECRET,
  developerToken: process.env.GOOGLE_ADS_DEVELOPER_TOKEN,
  refreshToken: process.env.GOOGLE_ADS_REFRESH_TOKEN,
  customerId: "123-456-7890",
});

// Run a GAQL query
const { results } = await query(client, `
  SELECT campaign.name, metrics.clicks
  FROM campaign
  WHERE segments.date DURING LAST_7_DAYS
`);

// Create a campaign with budget
const c = campaigns(client);
const resourceName = await c.create({
  name: "My Campaign",
  dailyBudgetMicros: toMicros(50), // $50/day
});

API

Client

const client = new GoogleAdsClient({
  clientId: "...",
  clientSecret: "...",
  developerToken: "...",
  refreshToken: "...",
  customerId: "123-456-7890",
  loginCustomerId: "...", // Optional, for MCC accounts
});

The client handles OAuth token refresh automatically and caches tokens until they expire.

Queries (GAQL)

import { query, queryAll } from "google-ads-kit";

// Single page
const { results } = await query(client, "SELECT campaign.name FROM campaign");

// Auto-paginate through all results
const allRows = await queryAll(client, "SELECT campaign.name FROM campaign");

Mutations

import { mutate } from "google-ads-kit";

// Raw mutate — same format as the REST API
await mutate(client, [
  {
    campaignOperation: {
      create: { name: "New Campaign", ... }
    }
  }
], { validateOnly: true });

Campaigns

import { campaigns } from "google-ads-kit";

const c = campaigns(client);

// Create (includes budget)
const resourceName = await c.create({
  name: "Spring Sale",
  dailyBudgetMicros: toMicros(25),
  status: "PAUSED", // default
});

// Update
await c.update(resourceName, { status: "ENABLED" });

// Set geo-targeting
await c.setLocations({
  campaignResourceName: resourceName,
  locationIds: [2840, 2124], // US, Canada
});

// Update budget
await c.updateBudget(budgetResourceName, toMicros(50));

Ad Groups

import { adGroups } from "google-ads-kit";

const ag = adGroups(client);

const adGroupResource = await ag.create({
  campaignResourceName: "customers/123/campaigns/456",
  name: "Brand Keywords",
  cpcBidMicros: toMicros(2.5),
});

Keywords

import { keywords } from "google-ads-kit";

const kw = keywords(client);

// Add keywords to an ad group
await kw.create({
  adGroupResourceName: "customers/123/adGroups/789",
  keywords: [
    { text: "running shoes", matchType: "PHRASE" },
    { text: "nike sneakers", matchType: "EXACT" },
  ],
});

// Add negative keywords to a campaign
await kw.addNegative({
  campaignResourceName: "customers/123/campaigns/456",
  keywords: ["free", "cheap", "used"],
});

Ads (RSA)

import { ads } from "google-ads-kit";

const a = ads(client);

// Create a Responsive Search Ad
await a.createRSA({
  adGroupResourceName: "customers/123/adGroups/789",
  headlines: [
    "Buy Running Shoes",
    "Free Shipping Today",
    "Top Rated Sneakers",
  ],
  descriptions: [
    "Shop our collection of premium running shoes.",
    "Free returns within 30 days. Order now!",
  ],
  finalUrl: "https://example.com/shoes",
});

// Validate without creating
await a.createRSA({ ...params, validateOnly: true });

Extensions

import { extensions } from "google-ads-kit";

const ext = extensions(client);

// Sitelinks
await ext.addSitelinks("customers/123/campaigns/456", [
  {
    linkText: "Shop Now",
    description1: "Browse our catalog",
    description2: "Free shipping available",
    finalUrl: "https://example.com/shop",
  },
]);

// Callouts
await ext.addCallouts("customers/123/campaigns/456", [
  { text: "Free Shipping" },
  { text: "24/7 Support" },
]);

// Structured Snippets
await ext.addSnippets("customers/123/campaigns/456", [
  { header: "Brands", values: ["Nike", "Adidas", "Puma"] },
]);

Reports

import { reports } from "google-ads-kit";

const r = reports(client);

const { results } = await r.campaignPerformance({
  start: "2026-03-01",
  end: "2026-03-15",
});

await r.keywordPerformance({ start: "2026-03-01", end: "2026-03-15" });
await r.searchTerms({ start: "2026-03-01", end: "2026-03-15" });
await r.adPerformance({ start: "2026-03-01", end: "2026-03-15" });

Conversions

import { conversions, conversionActionResourceName } from "google-ads-kit";

const conv = conversions(client);

await conv.uploadClick({
  gclid: "abc123",
  conversionAction: conversionActionResourceName("1234567890", "987"),
  conversionDateTime: "2026-03-15 12:00:00+00:00",
  conversionValue: 49.99,
  currencyCode: "USD",
});

Utilities

import {
  toMicros,
  fromMicros,
  campaignResourceName,
  adGroupResourceName,
  formatDate,
  dateRange,
} from "google-ads-kit";

toMicros(5.50);        // 5_500_000
fromMicros(5_500_000); // 5.50

campaignResourceName("123-456-7890", "111");
// "customers/1234567890/campaigns/111"

dateRange(30);
// { start: "2026-02-13", end: "2026-03-15" }

Features

  • REST-only — uses Google Ads REST API v21. No gRPC, no protobuf, no native bindings.
  • Works everywhere — Node.js 18+, Deno, Bun, Cloudflare Workers, Vercel Edge.
  • Zero heavy deps — uses built-in fetch. No google-gax, no grpc-js.
  • TypeScript-first — full type definitions, autocomplete-friendly API.
  • Token caching — OAuth tokens are cached and refreshed automatically.
  • Battle-tested — extracted from Fullrun's production codebase, managing real Google Ads accounts.

Fullrun

google-ads-kit is the open-source SDK that powers Fullrun — an AI agent that manages your Google Ads campaigns automatically. If you're building Google Ads tooling, use the SDK. If you just want your ads managed, use Fullrun.

Requirements

  • Node.js 18+ (or any runtime with global fetch)
  • Google Ads API credentials (setup guide)

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub.

License

MIT — built by Fullrun