Linear

@crvouga/mockingbird-service-linear

Stateful Linear public vendor API emulator with native namespaces, checkpoints and test controls.

Parity: Vendor API workflows compared with the pinned Emulate package oracleProductivity7 of 7 operationsIn-process fetchNode servermockingbird-linear
$
npm install -D @crvouga/mockingbird-service-linear

Playground

Requests go to the real emulator running in this tab. State persists across requests, and the journal shows what it received. A green dot marks operations whose sample succeeds as-is; others need ids from earlier responses.

Loads the real @crvouga/mockingbird-service-linear into this tab on first send
https://api.linear.app

Send a request to see the emulator's response.

Operations

7 of 7 operations in the vendored contract are emulated.

MethodPathOperationStatus
GET/GET /GET /
GET/graphqlGET /graphqlGET /graphql
POST/graphqlPOST /graphqlPOST /graphql
GET/oauth/authorizeGET /oauth/authorizeGET /oauth/authorize
POST/oauth/authorize/callbackPOST /oauth/authorize/callbackPOST /oauth/authorize/callback
POST/oauth/revokePOST /oauth/revokePOST /oauth/revoke
POST/oauth/tokenPOST /oauth/tokenPOST /oauth/token

Documentation

The package README, the same file that ships in the npm tarball.Edit on GitHub

Local emulators. Real API contracts. Part of Mockingbird.

GraphQL, OAuth, issues, teams, users, workflow states, comments, labels, projects, cycles, webhooks, agents, inspector. Runs through Mockingbird's portable Fetch runtime with SQLite persistence, namespaces, checkpoints, faults and admin controls.

Install

Shell
npm install @crvouga/mockingbird-service-linear

Usage

TypeScript
import { LinearClient } from "@linear/sdk"
import { createServer } from "@crvouga/mockingbird-service-linear/server"

// Test setup: the emulator, seeded with one synthetic team.
const team = { id: "0f0e8c1a-6f0b-4a53-9a43-3c7f0f1f2a10", key: "OPS", name: "Operations" }
const server = await createServer({ fixtures: { teams: [team] } })

// The app's own Linear client. Only its API URL changes.
const linear = new LinearClient({ apiKey: "lin_api_fixture", apiUrl: `${server.url}/graphql` })
const viewer = await linear.viewer
const created = await linear.createIssue({ teamId: team.id, title: "Fixture issue", assigneeId: viewer.id })
console.log(created.success) // true
if (created.issueId) await linear.createComment({ issueId: created.issueId, body: "Reproduced locally." })
await server.close()

The GraphQL schema is a subset of Linear's. With @linear/sdk 97, viewer and the create and update mutations work; model reads that select fields outside the subset (teams(), issues(), issue(id)) are rejected, so query those through linear.client.rawRequest with the fields you need.

API

  • LinearAPI: portable provider instance; accepts SQLite, namespace, clock, fixtures and baseUrl.
  • createRuntime: shared runtime, including native namespace and checkpoint controls.
  • LINEAR_NAMESPACE: default storage namespace.
  • document, operationIds, supportedOperationIds: registered provider route inventory.
  • createServer, DEFAULT_PORT, serveTarget from /server: loopback listener and CLI configuration.

fixtures accepts synthetic provider seed records. reset() restores defaults. Emulate 0.12.1 is a test oracle only, never a runtime dependency. Vendor handlers ported under Apache-2.0 retain their license and attribution; see LICENSE_EMULATE and THIRD_PARTY_NOTICES.md.

See SUPPORT.md for coverage and limits and API_EVIDENCE.md for validation status.

↑↓ to navigate↵ to open