@contractspec/example.integration-hub
v3.9.2
Published
Integration Hub example with sync engine and field mappings for ContractSpec
Readme
@contractspec/example.integration-hub
Website: https://contractspec.io
Integration Hub example with sync engine and field mappings for ContractSpec.
What This Demonstrates
- Connection management with typed schemas and enums.
- Integration lifecycle (create, configure, sync).
- Sync engine with field mapping and status tracking.
- MCP server example for tool integration.
- Capability and feature definition patterns.
- React UI with dashboard, hooks, markdown renderers, and shared ContractSpec tables for connections and sync configs.
- Contract-backed visualizations for integration mix, connection health, and sync-state comparison.
- Client-mode table capabilities including sorting, pagination, column visibility, pinning, resizing, and expanded operational details.
- Event definitions and operation test-specs.
- Managed/BYOK credential setup metadata with monorepo-aware Next and Expo env aliases.
Running Locally
From packages/examples/integration-hub:
bun run devbun run buildbun run testbun run typecheck
Usage
Use @contractspec/example.integration-hub as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
Architecture
src/connectionis part of the package's public or composition surface.src/docs/contains docblocks and documentation-facing exports.src/events.tsis package-level event definitions.src/example.tsis the runnable example entrypoint.src/handlers/contains handlers or demo adapters wired to contract surfaces.src/index.tsis the root public barrel and package entrypoint.src/integrationis part of the package's public or composition surface.src/setupexposes BYOK credential manifests, secret-reference fixtures, and monorepo env aliases.
Public Entry Points
- Export
.resolves through./src/index.ts. - Export
./connectionresolves through./src/connection/index.ts. - Export
./connection/connection.enumresolves through./src/connection/connection.enum.ts. - Export
./connection/connection.operationresolves through./src/connection/connection.operation.ts. - Export
./connection/connection.presentationresolves through./src/connection/connection.presentation.ts. - Export
./connection/connection.schemaresolves through./src/connection/connection.schema.ts. - Export
./docsresolves through./src/docs/index.ts. - Export
./docs/integration-hub.docblockresolves through./src/docs/integration-hub.docblock.ts. - Export
./eventsresolves through./src/events.ts. - Export
./exampleresolves through./src/example.ts. - Export
./setupresolves through./src/setup/index.ts. - Export
./setup/credential-setupresolves through./src/setup/credential-setup.ts. - The package publishes 46 total export subpaths; keep docs aligned with
package.json.
Local Commands
bun run dev— contractspec-bun-build devbun run build— bun run prebuild && bun run build:bundle && bun run build:typesbun run lint— bun lint:fixbun run lint:check— biome check .bun run lint:fix— biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .bun run typecheck— tsc --noEmitbun run validate— contractspec validate "src/**/*"bun run publish:pkg— bun publish --tolerate-republish --ignore-scripts --verbosebun run publish:pkg:canary— bun publish:pkg --tag canarybun run clean— rimraf dist .turbobun run build:bundle— contractspec-bun-build transpilebun run build:types— contractspec-bun-build typesbun run run:mcp— bun tsx src/run-mcp.tsbun run prebuild— contractspec-bun-build prebuild
Recent Updates
- Replace eslint+prettier by biomejs to optimize speed.
- Vnext ai-native.
- Missing contract layers.
- Resolve lint, build, and type errors across nine packages.
- Add Composio universal fallback, fix provider-ranking types, and expand package exports.
- Add first-class transport, auth, versioning, and BYOK support across all integrations.
- Add Integration Hub BYOK credential setup metadata and Next/Expo alias previews.
Notes
- Works alongside
@contractspec/lib.ai-agent,@contractspec/lib.contracts-spec,@contractspec/lib.design-system,@contractspec/lib.example-shared-ui,@contractspec/lib.runtime-sandbox, ...
