
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
google-ads-kit
Advanced tools
REST-first TypeScript SDK for the Google Ads API by Fullrun. No gRPC, no native bindings — works everywhere.
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-kitunder the hood to run an AI agent that manages your Google Ads campaigns — keyword optimization, bid management, ad creation, and more. No code required.
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.
npm install google-ads-kit
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
});
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.
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");
import { mutate } from "google-ads-kit";
// Raw mutate — same format as the REST API
await mutate(client, [
{
campaignOperation: {
create: { name: "New Campaign", ... }
}
}
], { validateOnly: true });
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));
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),
});
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"],
});
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 });
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"] },
]);
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" });
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",
});
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" }
fetch. No google-gax, no grpc-js.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.
fetch)Contributions are welcome! Please open an issue or pull request on GitHub.
MIT — built by Fullrun
FAQs
REST-first TypeScript SDK for the Google Ads API by Fullrun. No gRPC, no native bindings — works everywhere.
We found that google-ads-kit 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
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.