
Run local Google OAuth, OIDC, Gmail, Calendar, and Drive behavior without calling production Google APIs during sign-in and integration tests.
Install
npx skills add https://github.com/vercel-labs/emulate --skill googleWhat is this skill?
- OAuth 2.0 and OpenID Connect with authorization code flow, PKCE, ID tokens, OIDC discovery, and refresh tokens
- Gmail, Google Calendar, and Google Drive REST API emulation on a local service
- Start with `npx emulate --service google` (default http://localhost:4002) or programmatic `createEmulator`
- Point apps via `GOOGLE_EMULATOR_URL` and mapped OAuth URLs vs real Google endpoints
- Explicit triggers: mock Google login, Gmail API, Calendar, Drive, local Google auth
Adoption & trust: 174 installs on skills.sh; 1.3k GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Agent Browservercel-labs/open-agents
Tddmattpocock/skills
Use My Browserxixu-me/skills
Test Driven Developmentobra/superpowers
Verification Before Completionobra/superpowers
Webapp Testinganthropics/skills
Journey fit
Primary fit
Emulation is for verifying auth and Google API clients safely before release; Ship/testing is the canonical shelf for local test doubles. Testing subphase covers mock OAuth flows, PKCE, refresh tokens, and REST surfaces used in automated or manual QA.
Common Questions / FAQ
Is Google safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Google
# 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 ```bash # Google only npx emulate --service google # Default port # http://localhost:4002 ``` Or programmatically: ```typescript 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 ```bash GOOGLE_EMULATOR_URL=http://localhost:4002 ``` ### OAuth 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) ```typescript 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 ```typescript 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 ```typescript 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 ```yaml google: users: - email: testuser@gmail.com name: Test User given_name: Test family_name: User picture: ht