본문으로 건너뛰기
cccskills
무료GitHub에 공개

custom-apis

Build and share third-party HTTP API emulators with emulate. Use to emulate an external provider, add a custom service plugin, model stateful vendor endpoints, configure custom seeds, or package an emulator. For an existing built-in service, use that service's skill.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Custom emulators

Bring a third-party provider's HTTP API into local development, tests, and agent sandboxes. Implement the provider behavior your integration uses, run it alongside built-in services, and share the definition as a package.

Use the project's existing package manager for changes. End-user CLI examples use npx emulate because bare emulate is a zsh built-in. Requires Node 24 or later.

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.

Start from the scaffold when creating an emulator:

npm install -D emulate
npx emulate init --custom inventory
npx emulate start --watch

The scaffold creates a TypeScript definition and a Node test for an inventory API. Adapt its routes, state, and test to the third-party provider. It adds an entry to a discovered YAML, JSON, TypeScript, or JavaScript config, preserving existing services. For an unusual executable config, follow the manual import and registration instructions printed by the command. init prints the generated test path; use the service URL and Inspector link printed by start for requests because the port depends on the config.

Define the service with defineEmulator imported from emulate. state() returns fresh JSON-compatible data, and synchronous setup({ app, state, baseUrl, signal, onDispose }) registers handlers. State is inferred. Implement observable state transitions, validation, and errors from the actual API contract. Use author-controlled response shapes and IDs.

Keep mutable state in state(), not module-level variables. seed fully replaces initial state. Add validateSeed(value) for external fixtures. Snapshots are detached and versioned; increment stateVersion when changing persisted shape. Reset restores the captured seed and recreates handlers. Restore changes current state without changing the reset baseline.

The router provides get, post, put, patch, delete, on, use, onError, and notFound. Use c.req for headers, parameters, query, JSON, text, forms, or bytes, and return a native Response or c.json/text/html/body/redirect. Append cookies with c.header('Set-Cookie', value, { append: true }) to retain cookies already on the response. It is not a complete Hono implementation. There is no implicit custom authentication or rate limit. Keep /_emulate reserved for management.

Use baseUrl for advertised URLs, the lifecycle signal for asynchronous work, and onDispose for cleanup. An await can interleave concurrent handlers; protect domain invariants accordingly.

Register definitions in defineConfig({ services: { inventory: { emulator: inventory } } }). YAML/JSON entries can use local module paths or installed packages. Paths resolve from the config project. The CLI uses Node built-ins with support for TypeScript path aliases and inherited JSONC tsconfig files. Node 26 accepts erasable TypeScript only; compile enums and parameter properties to JavaScript before loading them. Node 24 also supports native TypeScript transforms. Use erasable TypeScript for definitions shared with native Node tests; JSX and compiler plugins are unsupported. Built-ins can appear alongside custom services. Instance names must not replace built-in names.

Validate the API in process:

const api = await createEmulator({ service: inventory, listen: false })
try {
  await api.request('/reservations', { method: 'POST' })
  const state = await (await api.request('/inventory')).json()
  await api.reset()
} finally {
  await api.close()
}

Import createEmulator from emulate. Use port: 0 and the returned url for HTTP SDK tests. Run the scaffold's test with node --test emulators/inventory.test.ts. Test reads after writes, domain errors, reset, and independent instances. Do not describe an API as implemented based only on matching response schemas.

The CLI inspector shows requests, routes, and state at the printed /_emulate URL. Structured previews and state redact token and secret fields such as access_token, refresh_token, and client_secret. Successful watch reloads reset the run to seed. With config auto-discovery, watch mode detects recognized config files created after startup. Creating a missing local import also retries a failed reload, including when the import is outside the config directory. Declare files read at runtime with config watch paths. Inspector is opt-in in programmatic and embedded usage. Reuse the same definition in Next/Nuxt adapter entries; root-relative redirects remain under the service mount while custom HTML stays unchanged. Export OPTIONS from the Next.js handler so preflight requests and custom OPTIONS routes reach the emulator. Close handlers in test teardown.

For persistence, use a custom entry's file path or filePersistence(path) from emulate. Automatic saves cover completed requests, including state changes made while streaming a response body, reset/restore, and controlled shutdown. Reset and close cancel active streams before running onDispose callbacks; pass the lifecycle signal to asynchronous work. Persistence is process-local coordination, not distributed locking. Publish plugins as built JavaScript plus declarations with an appropriate emulate peer dependency.

Reference: https://emulate.dev/docs/custom-emulators

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

apple

무료

Emulated Sign in with Apple / Apple OIDC for local development and testing. Use when the user needs to test Apple sign-in locally, emulate Apple OIDC discovery, handle Apple token exchange, configure Apple OAuth clients, or work with Apple userinfo without hitting real Apple APIs. Triggers include "Apple OAuth", "emulate Apple", "mock Apple login", "test Apple sign-in", "Sign in with Apple", "Apple OIDC", "local Apple auth", or any task requiring a local Apple OAuth/OIDC provider.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vercel-labs/emulate1.9천2026년 10월 15일 업데이트

aws

무료

Emulated AWS cloud services (S3, SQS, Cognito, IAM, STS) for local development and testing. Use when the user needs to interact with AWS API endpoints locally, test S3 bucket and object operations, emulate SQS queues and messages, test Cognito sign-up, sign-in, JWTs, or Identity Pools, manage IAM users/roles/access keys, test STS assume role, or work without hitting real AWS APIs. Triggers include "AWS emulator", "emulate AWS", "mock S3", "local SQS", "test IAM", "emulate S3", "AWS locally", "STS assume role", or any task requiring local AWS service emulation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vercel-labs/emulate1.9천2026년 10월 15일 업데이트

emulate

무료

Local drop-in API emulator for Vercel, GitHub, Google, Slack, Apple, Microsoft, AWS, Clerk, Linear, Twilio, and other developer APIs. Use when the user needs to start emulated services, configure seed data, write tests against local APIs, set up CI without network access, or work with the emulate CLI or programmatic API. Triggers include "start the emulator", "emulate services", "mock API locally", "create emulator config", "test against local API", "npx emulate", or any task requiring local service emulation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vercel-labs/emulate1.9천2026년 10월 15일 업데이트

github

무료

Emulated GitHub REST API for local development and testing. Use when the user needs to interact with GitHub API endpoints locally, test GitHub integrations, emulate repos/issues/PRs, set up GitHub OAuth flows, configure GitHub Apps, test webhooks, or work with actions/checks without hitting the real GitHub API. Triggers include "GitHub API", "emulate GitHub", "mock GitHub", "test GitHub OAuth", "GitHub App JWT", "local GitHub", or any task requiring a local GitHub API.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vercel-labs/emulate1.9천2026년 10월 15일 업데이트

google

무료

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vercel-labs/emulate1.9천2026년 10월 15일 업데이트

linear

무료

Emulated Linear GraphQL API for local development and testing. Use when the user needs to test Linear integrations locally, emulate Linear issues, comments, teams, workflow states, OAuth apps, webhooks, agent sessions, or work with the Linear API without hitting the real Linear service. Triggers include "Linear API", "emulate Linear", "mock Linear", "test Linear OAuth", "Linear webhook", "Linear agent", "local Linear", or any task requiring a local Linear API.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vercel-labs/emulate1.9천2026년 10월 15일 업데이트

vercel-labs의 스킬 모두 보기

이 스킬의 문제 신고