Skill1.9k starsChanged 7 months agoApache-2.0View on GitHub
Emulated Google OAuth 2.0, OpenID Connect, Gmail, Calendar, and Drive for local development and testing. Use when the user needs to test Google sign-in locally, emulate OIDC discovery, handle Google token exchange, configure Google OAuth clients, work with Gmail messages/drafts/threads/labels, manage Calendar events, upload or list Drive files, or work with Google userinfo without hitting real Google APIs. Triggers include "Google OAuth", "emulate Google", "mock Google login", "test Google sign-in", "OIDC emulator", "Google OIDC", "Gmail API", "Google Calendar", "Google Drive", "local Google auth", or any task requiring a local Google API.
- Reads credentials
- Sends data out
8 other projects use a version of this.
Trending
More talk lately.about the whole repository
Most recently taken up by
- delorenj/skillstheir own version, first seen Oct 2, 2026
- cyrusagents/cyrustheir own version, first seen Sep 24, 2026
- ckorhonen/claude-skillstheir own version, first seen Jul 5, 2026
- odyssey4me/agent-skillstheir own version, first seen Jun 25, 2026
- sh0wrun/skillstheir own version, first seen May 22, 2026
- rainday/smart-blog-skillstheir own version, first seen May 15, 2026
Who's talking about vercel-labs/emulate
- @sungkim.bsky.social“emulate Local drop-in replacement services for CI and no-network sandboxes. Fully stateful, …”Bluesky · Mar 26, 2026 · 9 likes
- @topickapp.bsky.social“https://github.com/vercel-labs/emulate CIやネットワーク制限下で使える、ローカルAPIエミュレーター集です。 …”Bluesky · Apr 6, 2026 · 2 likes
- @tech-trending.bsky.social“GitHub - vercel-labs/emulate: Local API emulation for CI and no-network sandboxes …”Bluesky · Apr 5, 2026 · 2 likes
- MarcosCamara01/ecommerce-template“chore(deps): bump the development-minor-patch group across 1 directory with 8 updates”GitHub · Sep 21, 2026 · 1 reactions
- MarcosCamara01/ecommerce-template“chore(deps): bump the development-minor-patch group with 7 updates”GitHub · Sep 14, 2026 · 1 reactions
The biggest 5 of 54 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 54
Talked about on GitHub and Bluesky (54 times).
On GitHub · 48
- Sep 21, 2026chore(deps): bump the development-minor-patch group across 1 directory with 8 updates — MarcosCamara01/ecommerce-template1 reaction · 2 comments
- Sep 14, 2026chore(deps): bump the development-minor-patch group with 7 updates — MarcosCamara01/ecommerce-template1 reaction · 2 comments
- Sep 8, 2026chore(deps): bump the development-minor-patch group with 9 updates — MarcosCamara01/ecommerce-template1 reaction · 3 comments
- Oct 5, 2026chore(deps): bump the typescript-dependencies group across 9 directories with 8 updates — paradigmxyz/centaur0 reactions
- Oct 4, 2026agent-skills.github.vercel-labs.emulate: 0.11.2 → 0.12.1 — sudosubin/agents.nix0 reactions
43 more on GitHub
- Oct 3, 2026agent-skills.github.vercel-labs.emulate: init at 0.11.2 — sudosubin/agents.nix0 reactions
- Oct 3, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 30, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 28, 2026chore(deps): bump the typescript-dependencies group across 7 directories with 5 updates — paradigmxyz/centaur0 reactions
- Sep 28, 2026chore(deps): bump the development-minor-patch group with 10 updates — demo-nexoar/ecommerce0 reactions
- Sep 28, 2026chore(deps-dev): bump emulate from 0.11.2 to 0.12.0 — biw/scaleset0 reactions
- Sep 28, 2026chore(deps): bump the development-minor-patch group across 1 directory with 9 updates — MarcosCamara01/ecommerce-template0 reactions · 1 comment
- Sep 24, 2026@shared/email: make the Resend API base URL configurable for local emulation — englishstreetventures/osn0 reactions
- Sep 24, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 23, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 23, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 21, 2026deps: bump the dev group across 1 directory with 14 updates — pai-list/AxiomID0 reactions · 2 comments
- Sep 19, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 19, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 18, 2026chore(deps-dev): bump emulate from 0.9.0 to 0.11.2 — plenoai/metsuke0 reactions · 1 comment
- Sep 14, 2026deps: bump the dev group across 1 directory with 13 updates — pai-list/AxiomID0 reactions · 3 comments
- Sep 11, 2026chore(deps-dev): bump emulate from 0.9.0 to 0.11.1 — plenoai/metsuke0 reactions · 1 comment
- Sep 10, 2026chore(deps): bump the monthly-batch group with 32 updates — withAutograph/autograph-app-builder0 reactions · 1 comment
- Sep 3, 2026chore(deps): bump the minor-and-patch group across 1 directory with 7 updates — pleaseai/asana0 reactions · 4 comments
- Aug 31, 2026deps: bump the dev group across 1 directory with 13 updates — pai-list/AxiomID0 reactions · 3 comments
- Aug 27, 2026chore(deps): bump the minor-and-patch group across 1 directory with 6 updates — pleaseai/asana0 reactions · 5 comments
- Aug 26, 2026Complete Kimi K3 architecture review loop — dearlordylord/emulate0 reactions
- Aug 25, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 24, 2026deps: bump the dev group across 1 directory with 7 updates — pai-list/AxiomID0 reactions · 3 comments
- Aug 24, 2026chore(deps-dev): bump the dev-dependencies group across 1 directory with 20 updates — pleaseai/emulate0 reactions · 3 comments
- Aug 24, 2026chore(deps): bump the production-dependencies group across 1 directory with 3 updates — pleaseai/emulate0 reactions · 3 comments
- Aug 21, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 21, 2026chore(deps-dev): bump emulate from 0.9.0 to 0.10.0 — plenoai/metsuke0 reactions · 1 comment
- Aug 18, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 14, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Jul 16, 2026📕 Vercel Emulate — recreate — BLamy/orly0 reactions · 2 comments
- Jul 4, 2026chore(deps)(deps-dev): bump @emulators/github from 0.8.0 to 0.9.0 — pai-list/AxiomID0 reactions · 4 comments
- Jul 3, 2026chore(deps-dev): bump emulate from 0.8.0 to 0.9.0 — plenoai/metsuke0 reactions
- Jun 29, 2026deps: bump the dev group with 5 updates — pai-list/AxiomID0 reactions · 2 comments
- Jun 26, 2026chore(deps-dev): bump emulate from 0.7.0 to 0.8.0 — plenoai/metsuke0 reactions · 2 comments
- Jun 23, 2026[book] Vercel Emulate — BLamy/orly0 reactions · 2 comments
- Jun 22, 2026deps: bump the dev group with 4 updates — pai-list/AxiomID0 reactions · 2 comments
- Jun 19, 2026chore(deps-dev): bump emulate from 0.6.1 to 0.7.0 — plenoai/metsuke0 reactions · 1 comment
- Jun 15, 2026chore(deps): bump the production-dependencies group across 1 directory with 2 updates — pleaseai/emulate0 reactions · 5 comments
- Jun 12, 2026chore(deps-dev): bump emulate from 0.6.0 to 0.6.1 — plenoai/metsuke0 reactions
- May 26, 2026chore(deps-dev): bump emulate from 0.4.1 to 0.6.0 — plenoai/metsuke0 reactions · 1 comment
- May 8, 2026Add example-stripe: subscription checkout with emulate + drizzle + vitest — remorses/spiceflow0 reactions · 1 comment
- Apr 21, 2026End-to-end testing for grammY bots via a Bot API emulator — grammyjs/grammYsays it tested it0 reactions · 6 comments
On Bluesky · 6
- Mar 26, 2026emulate Local drop-in replacement services for CI and no-network sandboxes. Fully stateful, production-fidelity API emulation. Not mocks.… — @sungkim.bsky.social9 likes and reposts
- Apr 6, 2026https://github.com/vercel-labs/emulate CIやネットワーク制限下で使える、ローカルAPIエミュレーター集です。 VercelやGitHub、Google、Slack、Apple、Microsoft、AWSを再現できます。… — @topickapp.bsky.social2 likes and reposts
- Apr 5, 2026GitHub - vercel-labs/emulate: Local API emulation for CI and no-network sandboxes https://github.com/vercel-labs/emulate — @tech-trending.bsky.social2 likes and reposts
- Apr 10, 2026github.com/vercel-labs/emulate GitHub - vercel-labs/emulate: Local API emulation for CI and no-network sandboxes — @technews4869.bsky.social1 likes and repost
- Apr 9, 2026サーバー側のレンダリングをエミュレートして検証できるVercelの開発用ツールっぽい 複雑な構成のデプロイ前に動作確認できて便利そう yug1224 starred vercel-labs/emulate… — @yug1224.com1 likes and repost
1 more on Bluesky
- Apr 5, 2026VercelやGitHub、Google、Slack、AWS(S3/SQS)などのAPIをローカルでエミュレートするツール。 CIやネットワークのないサンドボックス環境で、外部APIのモックサーバとして利用できる。 各サービスはステートフルにデータを保持し、OAuth… — @azu.bsky.social1 likes and repost
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- cyrusagents/cyrus★ 846same name
- rainday/smart-blog-skills★ 35same name
- snyk-labs/toxicskills-goof★ 20same name
- ckorhonen/claude-skills★ 18same name
- delorenj/skills★ 15same name
- odyssey4me/agent-skills★ 13same name
- mediause/agent-skills★ 9same name
- sh0wrun/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 182
When no OAuth clients are configured, the emulator accepts any client_id.
- Very specific: line 276
All Gmail endpoints are under /gmail/v1/users/:userId/...
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Google OAuth 2.0 / OIDC + Gmail, Calendar & Drive Emulator
OAuth 2.0 and OpenID Connect emulation with authorization code flow, PKCE support, ID tokens, OIDC discovery, refresh tokens, plus Gmail, Google Calendar, and Google Drive REST API surfaces.
Start
Local listeners bind to 127.0.0.1 by default. For access from containers or other machines, pass --host 0.0.0.0 to the CLI or hostname: '0.0.0.0' to createEmulator. Configure --base-url or baseUrl for advertised URLs reachable by those clients.
# Google only
npx emulate --service google
# Default port
# http://localhost:4002Or programmatically:
import { createEmulator } from 'emulate'
const google = await createEmulator({ service: 'google', port: 4002 })
// google.url === 'http://localhost:4002'Pointing Your App at the Emulator
Environment Variable
GOOGLE_EMULATOR_URL=http://localhost:4002OAuth URL Mapping
| Real Google URL | Emulator URL |
https://accounts.google.com/o/oauth2/v2/auth | $GOOGLE_EMULATOR_URL/o/oauth2/v2/auth |
https://oauth2.googleapis.com/token | $GOOGLE_EMULATOR_URL/oauth2/token |
https://www.googleapis.com/oauth2/v2/userinfo | $GOOGLE_EMULATOR_URL/oauth2/v2/userinfo |
https://accounts.google.com/.well-known/openid-configuration | $GOOGLE_EMULATOR_URL/.well-known/openid-configuration |
https://www.googleapis.com/oauth2/v3/certs | $GOOGLE_EMULATOR_URL/oauth2/v3/certs |
https://gmail.googleapis.com/gmail/v1/... | $GOOGLE_EMULATOR_URL/gmail/v1/... |
https://www.googleapis.com/calendar/v3/... | $GOOGLE_EMULATOR_URL/calendar/v3/... |
https://www.googleapis.com/drive/v3/... | $GOOGLE_EMULATOR_URL/drive/v3/... |
google-auth-library (Node.js)
import { OAuth2Client } from 'google-auth-library'
const GOOGLE_URL = process.env.GOOGLE_EMULATOR_URL ?? 'https://accounts.google.com'
const client = new OAuth2Client({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
redirectUri: 'http://localhost:3000/api/auth/callback/google',
})
const emulatorAuthorizeUrl = `${GOOGLE_URL}/o/oauth2/v2/auth?client_id=${process.env.GOOGLE_CLIENT_ID}&redirect_uri=...&scope=openid+email+profile&response_type=code&state=...`Auth.js / NextAuth.js
import Google from '@auth/core/providers/google'
Google({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
authorization: {
url: `${process.env.GOOGLE_EMULATOR_URL}/o/oauth2/v2/auth`,
params: { scope: 'openid email profile' },
},
token: {
url: `${process.env.GOOGLE_EMULATOR_URL}/oauth2/token`,
},
userinfo: {
url: `${process.env.GOOGLE_EMULATOR_URL}/oauth2/v2/userinfo`,
},
})Passport.js
import { Strategy as GoogleStrategy } from 'passport-google-oauth20'
const GOOGLE_URL = process.env.GOOGLE_EMULATOR_URL ?? 'https://accounts.google.com'
new GoogleStrategy({
clientID: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
callbackURL: 'http://localhost:3000/api/auth/callback/google',
authorizationURL: `${GOOGLE_URL}/o/oauth2/v2/auth`,
tokenURL: `${GOOGLE_URL}/oauth2/token`,
userProfileURL: `${GOOGLE_URL}/oauth2/v2/userinfo`,
}, verifyCallback)Seed Config
google:
users:
- email: testuser@gmail.com
name: Test User
given_name: Test
family_name: User
picture: https://lh3.googleusercontent.com/a/default-user
email_verified: true
locale: en
- email: dev@example.com
name: Developer
- email: admin@acme.com
name: Admin
hd: acme.com
oauth_clients:
- client_id: my-client-id.apps.googleusercontent.com
client_secret: GOCSPX-secret
name: My App
redirect_uris:
- http://localhost:3000/api/auth/callback/google
labels:
- id: Label_ops
user_email: testuser@gmail.com
name: Ops/Review
color_background: "#DDEEFF"
color_text: "#111111"
messages:
- id: msg_welcome
user_email: testuser@gmail.com
thread_id: thr_welcome
from: "welcome@example.com"
to: testuser@gmail.com
subject: Welcome to the Gmail emulator
body_text: You can now test Gmail flows locally.
label_ids: [INBOX, UNREAD, CATEGORY_UPDATES]
date: "2025-01-04T10:00:00.000Z"
calendars:
- id: primary
user_email: testuser@gmail.com
summary: testuser@gmail.com
primary: true
selected: true
time_zone: UTC
calendar_events:
- id: evt_kickoff
user_email: testuser@gmail.com
calendar_id: primary
summary: Project Kickoff
start_date_time: "2025-01-10T09:00:00.000Z"
end_date_time: "2025-01-10T09:30:00.000Z"
attendees:
- email: testuser@gmail.com
display_name: Test User
conference_entry_points:
- entry_point_type: video
uri: https://meet.google.com/example
label: Google Meet
hangout_link: https://meet.google.com/example
drive_items:
- id: drv_docs
user_email: testuser@gmail.com
name: Docs
mime_type: application/vnd.google-apps.folder
parent_ids: [root]
- id: drv_readme
user_email: testuser@gmail.com
name: README.md
mime_type: text/markdown
parent_ids: [drv_docs]
data: "# Hello World"When no OAuth clients are configured, the emulator accepts any client_id. With clients configured, strict validation is enforced for client_id, client_secret, and redirect_uri.
Hosted domain (hd) claim
Google Workspace accounts include an hd claim in ID tokens and userinfo responses identifying the user's hosted domain. The emulator derives this automatically from the user's email domain. Consumer domains (gmail.com, googlemail.com) omit the claim, matching real Google behavior.
To override the derived value, set hd on a seeded user. To suppress the claim entirely, set hd to an empty string.
OAuth / OIDC Endpoints
OIDC Discovery
curl http://localhost:4002/.well-known/openid-configurationJWKS
curl http://localhost:4002/oauth2/v3/certsReturns the RSA public key used to verify the ID tokens issued by the emulator. Google ID tokens use RS256, and the discovery document advertises the same algorithm.
Authorization
# Browser flow: redirects to a user picker page
curl -v "http://localhost:4002/o/oauth2/v2/auth?\
client_id=my-client-id.apps.googleusercontent.com&\
redirect_uri=http://localhost:3000/api/auth/callback/google&\
scope=openid+email+profile&\
response_type=code&\
state=random-state&\
nonce=random-nonce"Supports code_challenge and code_challenge_method for PKCE.
Token Exchange
curl -X POST http://localhost:4002/oauth2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "code=<authorization_code>&\
client_id=my-client-id.apps.googleusercontent.com&\
client_secret=GOCSPX-secret&\
redirect_uri=http://localhost:3000/api/auth/callback/google&\
grant_type=authorization_code"Also accepts application/json body. Returns:
{
"access_token": "google_...",
"refresh_token": "google_refresh_...",
"id_token": "<jwt>",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "openid email profile"
}Refresh Token
curl -X POST http://localhost:4002/oauth2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "refresh_token=google_refresh_...&\
client_id=my-client-id.apps.googleusercontent.com&\
client_secret=GOCSPX-secret&\
grant_type=refresh_token"Returns a new access_token (no new refresh_token or id_token on refresh).
User Info
curl http://localhost:4002/oauth2/v2/userinfo \
-H "Authorization: Bearer google_..."Token Revocation
curl -X POST http://localhost:4002/oauth2/revoke \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "token=google_..."Gmail API
All Gmail endpoints are under /gmail/v1/users/:userId/... where :userId is me or the authenticated user's email.
Messages
# List messages (filter by labels, search query)
curl "http://localhost:4002/gmail/v1/users/me/messages?labelIds=INBOX&q=from:welcome&maxResults=10" \
-H "Authorization: Bearer $TOKEN"
# Get message (format: full, metadata, minimal, raw)
curl "http://localhost:4002/gmail/v1/users/me/messages/msg_welcome?format=full" \
-H "Authorization: Bearer $TOKEN"
# Send message
curl -X POST http://localhost:4002/gmail/v1/users/me/messages/send \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"to": "someone@example.com", "subject": "Hello", "body_text": "Hi there"}'
# Insert message (bypass send)
curl -X POST http://localhost:4002/gmail/v1/users/me/messages \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"to": "test@example.com", "from": "me@example.com", "subject": "Test", "body_text": "Body", "labelIds": ["INBOX"]}'
# Import message
curl -X POST http://localhost:4002/gmail/v1/users/me/messages/import \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"to": "test@example.com", "from": "external@example.com", "subject": "Imported", "body_text": "Content"}'
# Modify labels on a message
curl -X POST http://localhost:4002/gmail/v1/users/me/messages/msg_welcome/modify \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"addLabelIds": ["STARRED"], "removeLabelIds": ["UNREAD"]}'
# Trash / untrash
curl -X POST http://localhost:4002/gmail/v1/users/me/messages/msg_welcome/trash \
-H "Authorization: Bearer $TOKEN"
curl -X POST http://localhost:4002/gmail/v1/users/me/messages/msg_welcome/untrash \
-H "Authorization: Bearer $TOKEN"
# Delete permanently
curl -X DELETE http://localhost:4002/gmail/v1/users/me/messages/msg_welcome \
-H "Authorization: Bearer $TOKEN"
# Batch modify
curl -X POST http://localhost:4002/gmail/v1/users/me/messages/batchModify \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"ids": ["msg_welcome", "msg_build"], "addLabelIds": ["STARRED"]}'
# Batch delete
curl -X POST http://localhost:4002/gmail/v1/users/me/messages/batchDelete \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"ids": ["msg_welcome"]}'
# Get attachment
curl http://localhost:4002/gmail/v1/users/me/messages/msg_id/attachments/att_id \
-H "Authorization: Bearer $TOKEN"Upload variants also available at /upload/gmail/v1/users/:userId/messages, .../messages/send, .../messages/import.
Drafts
# List drafts
curl http://localhost:4002/gmail/v1/users/me/drafts \
-H "Authorization: Bearer $TOKEN"
# Create draft
curl -X POST http://localhost:4002/gmail/v1/users/me/drafts \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"message": {"to": "someone@example.com", "subject": "Draft subject", "body_text": "Draft body"}}'
# Get draft (format: full, metadata, minimal, raw)
curl "http://localhost:4002/gmail/v1/users/me/drafts/draft_id?format=full" \
-H "Authorization: Bearer $TOKEN"
# Update draft
curl -X PUT http://localhost:4002/gmail/v1/users/me/drafts/draft_id \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"message": {"subject": "Updated subject", "body_text": "Updated body"}}'
# Send draft
curl -X POST http://localhost:4002/gmail/v1/users/me/drafts/send \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"id": "draft_id"}'
# Delete draft
curl -X DELETE http://localhost:4002/gmail/v1/users/me/drafts/draft_id \
-H "Authorization: Bearer $TOKEN"Threads
# List threads (filter by labels, search query)
curl "http://localhost:4002/gmail/v1/users/me/threads?labelIds=INBOX&maxResults=20" \
-H "Authorization: Bearer $TOKEN"
# Get thread (all messages in thread)
curl "http://localhost:4002/gmail/v1/users/me/threads/thr_welcome?format=full" \
-H "Authorization: Bearer $TOKEN"
# Modify labels on all messages in thread
curl -X POST http://localhost:4002/gmail/v1/users/me/threads/thr_welcome/modify \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"addLabelIds": ["STARRED"], "removeLabelIds": ["UNREAD"]}'
# Trash / untrash / delete thread
curl -X POST http://localhost:4002/gmail/v1/users/me/threads/thr_welcome/trash \
-H "Authorization: Bearer $TOKEN"
curl -X DELETE http://localhost:4002/gmail/v1/users/me/threads/thr_welcome \
-H "Authorization: Bearer $TOKEN"Labels
# List labels
curl http://localhost:4002/gmail/v1/users/me/labels \
-H "Authorization: Bearer $TOKEN"
# Get label
curl http://localhost:4002/gmail/v1/users/me/labels/INBOX \
-H "Authorization: Bearer $TOKEN"
# Create label
curl -X POST http://localhost:4002/gmail/v1/users/me/labels \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "My Label", "color": {"backgroundColor": "#DDEEFF", "textColor": "#111111"}}'
# Update label (PUT replaces, PATCH merges)
curl -X PATCH http://localhost:4002/gmail/v1/users/me/labels/Label_ops \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Ops/Reviewed"}'
# Delete label (user labels only)
curl -X DELETE http://localhost:4002/gmail/v1/users/me/labels/Label_ops \
-H "Authorization: Bearer $TOKEN"History & Watch
# List history changes since a given historyId
curl "http://localhost:4002/gmail/v1/users/me/history?startHistoryId=1&historyTypes=messageAdded&maxResults=100" \
-H "Authorization: Bearer $TOKEN"
# Set up push notification watch (stub)
curl -X POST http://localhost:4002/gmail/v1/users/me/watch \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"topicName": "projects/my-project/topics/gmail", "labelIds": ["INBOX"]}'
# Stop watch
curl -X POST http://localhost:4002/gmail/v1/users/me/stop \
-H "Authorization: Bearer $TOKEN"Settings
# List filters
curl http://localhost:4002/gmail/v1/users/me/settings/filters \
-H "Authorization: Bearer $TOKEN"
# Create filter (auto-label incoming messages matching criteria)
curl -X POST http://localhost:4002/gmail/v1/users/me/settings/filters \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"criteria": {"from": "alerts@example.com"}, "action": {"addLabelIds": ["Label_ops"]}}'
# Delete filter
curl -X DELETE http://localhost:4002/gmail/v1/users/me/settings/filters/filter_id \
-H "Authorization: Bearer $TOKEN"
# List forwarding addresses
curl http://localhost:4002/gmail/v1/users/me/settings/forwardingAddresses \
-H "Authorization: Bearer $TOKEN"
# List send-as aliases
curl http://localhost:4002/gmail/v1/users/me/settings/sendAs \
-H "Authorization: Bearer $TOKEN"Google Calendar API
Discovery
The Calendar discovery document is public and describes the Calendar v3 methods supported by the emulator:
curl http://localhost:4002/discovery/v1/apis/calendar/v3/restCalendar List
curl http://localhost:4002/calendar/v3/users/me/calendarList \
-H "Authorization: Bearer $TOKEN"Events
# List events (filter by time range, search, order)
curl "http://localhost:4002/calendar/v3/calendars/primary/events?\
timeMin=2025-01-01T00:00:00Z&timeMax=2025-12-31T23:59:59Z&maxResults=50&orderBy=startTime" \
-H "Authorization: Bearer $TOKEN"
# Create event
curl -X POST http://localhost:4002/calendar/v3/calendars/primary/events \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"summary": "Team Meeting", "start": {"dateTime": "2025-01-10T14:00:00Z"}, "end": {"dateTime": "2025-01-10T15:00:00Z"}, "attendees": [{"email": "dev@example.com"}]}'
# Delete event
curl -X DELETE http://localhost:4002/calendar/v3/calendars/primary/events/evt_kickoff \
-H "Authorization: Bearer $TOKEN"FreeBusy
curl -X POST http://localhost:4002/calendar/v3/freeBusy \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"timeMin": "2025-01-10T00:00:00Z", "timeMax": "2025-01-10T23:59:59Z", "items": [{"id": "primary"}]}'Google Drive API
Files
# List files (with query filter, pagination, ordering)
curl "http://localhost:4002/drive/v3/files?q='root'+in+parents&pageSize=20" \
-H "Authorization: Bearer $TOKEN"
# Create file (JSON metadata)
curl -X POST http://localhost:4002/drive/v3/files \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "notes.txt", "mimeType": "text/plain", "parents": ["root"]}'
# Create file with content (multipart/related upload)
curl -X POST http://localhost:4002/upload/drive/v3/files \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: multipart/related; boundary=boundary" \
--data-binary $'--boundary\r\nContent-Type: application/json\r\n\r\n{"name":"data.csv","mimeType":"text/csv"}\r\n--boundary\r\nContent-Type: text/csv\r\n\r\na,b,c\n1,2,3\r\n--boundary--'
# Get file metadata
curl http://localhost:4002/drive/v3/files/drv_readme \
-H "Authorization: Bearer $TOKEN"
# Download file content
curl "http://localhost:4002/drive/v3/files/drv_readme?alt=media" \
-H "Authorization: Bearer $TOKEN"
# Update file (PATCH or PUT; move parents with query params)
curl -X PATCH "http://localhost:4002/drive/v3/files/drv_readme?addParents=folder_id&removeParents=root" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "README-updated.md"}'Common Patterns
Full Authorization Code Flow
GOOGLE_URL="http://localhost:4002"
CLIENT_ID="my-client-id.apps.googleusercontent.com"
CLIENT_SECRET="GOCSPX-secret"
REDIRECT_URI="http://localhost:3000/api/auth/callback/google"
# 1. Open in browser (user picks a seeded account)
# $GOOGLE_URL/o/oauth2/v2/auth?client_id=$CLIENT_ID&redirect_uri=$REDIRECT_URI&scope=openid+email+profile&response_type=code&state=abc
# 2. After user selection, emulator redirects to:
# $REDIRECT_URI?code=<code>&state=abc
# 3. Exchange code for tokens
curl -X POST $GOOGLE_URL/oauth2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "code=<code>&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&redirect_uri=$REDIRECT_URI&grant_type=authorization_code"
# 4. Fetch user info with the access_token
curl $GOOGLE_URL/oauth2/v2/userinfo \
-H "Authorization: Bearer <access_token>"OIDC Discovery-Based Setup
import { Issuer } from 'openid-client'
const googleIssuer = await Issuer.discover(
process.env.GOOGLE_EMULATOR_URL ?? 'https://accounts.google.com'
)
const client = new googleIssuer.Client({
client_id: process.env.GOOGLE_CLIENT_ID,
client_secret: process.env.GOOGLE_CLIENT_SECRET,
redirect_uris: ['http://localhost:3000/api/auth/callback/google'],
})Send a Gmail Message and Check the Thread
TOKEN="test_token_admin"
BASE="http://localhost:4002"
# Send a message
curl -X POST $BASE/gmail/v1/users/me/messages/send \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"to": "someone@example.com", "subject": "Test", "body_text": "Hello"}'
# List threads in INBOX
curl "$BASE/gmail/v1/users/me/threads?labelIds=INBOX" \
-H "Authorization: Bearer $TOKEN"Custom emulators alongside built-ins
Use npx emulate init --custom inventory to scaffold a third-party API emulator and test. Register it in emulate.config.ts with defineConfig from emulate, alongside built-in entries such as { emulator: "google" }. Run npx emulate start --watch to reload imports and inspect custom state at the printed /_emulate URL. Successful reloads reset the run to seed. Existing flat seed configs still work; --config selects an explicit file. For authoring and testing third-party API emulators, see https://emulate.dev/docs/custom-emulators.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

