{"id":45106565,"url":"https://github.com/stackables/bridge","last_synced_at":"2026-04-01T18:44:29.305Z","repository":{"id":339371876,"uuid":"1161122579","full_name":"stackables/bridge","owner":"stackables","description":"Declarative dataflow for GraphQL","archived":false,"fork":false,"pushed_at":"2026-03-16T20:30:24.000Z","size":4610,"stargazers_count":8,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-16T21:47:52.419Z","etag":null,"topics":["dsl","gateway","graphql"],"latest_commit_sha":null,"homepage":"https://bridge.sdk42.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackables.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-18T18:58:54.000Z","updated_at":"2026-03-15T12:27:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/stackables/bridge","commit_stats":null,"previous_names":["stackables/bridge"],"tags_count":76,"template":false,"template_full_name":null,"purl":"pkg:github/stackables/bridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackables%2Fbridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackables%2Fbridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackables%2Fbridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackables%2Fbridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackables","download_url":"https://codeload.github.com/stackables/bridge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackables%2Fbridge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dsl","gateway","graphql"],"created_at":"2026-02-19T22:01:19.239Z","updated_at":"2026-04-01T18:44:29.296Z","avatar_url":"https://github.com/stackables.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"[![codecov](https://codecov.io/gh/stackables/bridge/graph/badge.svg?token=47dHG2sfNe)](https://codecov.io/gh/stackables/bridge)\n[![npm](https://img.shields.io/npm/v/@stackables/bridge?label=@stackables/bridge\u0026logo=npm)](https://www.npmjs.com/package/@stackables/bridge)\n[![extension](https://img.shields.io/badge/VS_Code-Full_Support-blue)](https://marketplace.visualstudio.com/items?itemName=stackables.bridge-syntax-highlight)\n\n# The Bridge\n\n**A declarative dataflow language and execution engine.**\n\nDocumentation at: https://bridge.sdk42.com/\n\nThe Bridge replaces imperative orchestration code with static `.bridge` files. Instead of writing complex `async/await` logic, manual `Promise.all` wrappers, and custom data mappers, you simply define **what** data you need and **where** it comes from.\n\nThe Bridge engine parses your wiring diagram, builds a dependency graph, and executes it - automatically handling parallelization, fallbacks, and data reshaping.\n\n- [See our roadmap](https://github.com/stackables/bridge/milestones)\n- [Feedback in the discussions](https://github.com/stackables/bridge/discussions/1)\n- [Performance report - interpreter](./packages/bridge-core/performance.md)\n- [Performance report - compiler](./packages/bridge-compiler/performance.md)\n\n### How it looks\n\nYou write the topology; the engine handles the execution.\n\n![suntax image](./docs/images/syntax-image.png)\n\n### Why a language instead of code?\n\n- **Zero Orchestration Boilerplate:** The engine inherently knows which tools can run concurrently. No manual `Promise.all`, DataLoader plumbing, or batching glue required.\n- **Separation of Concerns:** Keep your core business logic inside isolated TypeScript tools, completely separate from your routing, mapping, and orchestration logic.\n- **Safe for LLM Automation:** Because The Bridge is a strictly declarative, constrained dataflow language, it is much safer for AI generation than general-purpose code. You can confidently let an LLM wire up your API mappings without the risk of it hallucinating infinite loops, memory leaks, or rogue system calls.\n- **Hot-Reloadable Logic:** Since `.bridge` files are just text parsed into an execution graph, you don't need to recompile, rebuild, or redeploy your entire Node application to change a data mapping or swap an API provider. You can update and hot-reload your rules on the fly.\n- **Portable Execution:** The engine is hyper-lightweight and framework-agnostic. Run it in a Node backend, an Edge Worker (Cloudflare/Vercel), or directly in the browser.\n\n### Primary Use Cases\n\nBecause The Bridge strictly controls how data flows from inputs to tools to outputs, it is the perfect engine for architectures that require strict boundaries and clean mappings.\n\n1. **[The \"No-Code\" BFF (Backend-for-Frontend)](https://bridge.sdk42.com/guides/bff/)**\n   Spin up a GraphQL BFF without maintaining a secondary codebase of resolvers, types, and DTOs. Frontend teams can aggregate and shape backend data just by writing `.bridge` files.\n1. **[The Egress Gateway](https://bridge.sdk42.com/guides/egress/)**\n   Funnel external third-party API calls through a single point. Swap providers (e.g., SendGrid ↔ AWS SES) by changing a `.bridge` file without ever touching the calling service's code.\n1. **[The Rule Engine / Policy Evaluator](https://bridge.sdk42.com/guides/rule-engine/)**\n   Encapsulate complex conditional business logic and data enrichment into a single, highly readable file that returns a boolean. Perfect for authorization checks or fraud detection flows.\n\n### Feature Highlights\n\n- **Human-Readable Runtime Errors:** `formatBridgeError(err)` renders Rust-style source snippets with filename, line/column, and carets pointing at the failing wire.\n- **Native DataLoader Pattern:** Mark a custom tool with `bridge.batch` and Bridge batches loop-scoped calls automatically in both the interpreter and the compiler.\n\n## The Playground\n\nTry The Bridge instantly in your browser at **[https://bridge.sdk42.com/playground/](https://bridge.sdk42.com/playground/)**\n\nThe playground is fully client-side. **Your API keys, schemas, and data are NEVER sent to our servers.** All parsing, routing, and HTTP execution happens directly inside your browser.\n\nWant to run it offline or within your own VPN? You can spin up the playground locally by building the `./packages/playground` workspace directly from this repository.\n\n![Playground Screenshot](./docs/images/screenshot-playground.png)\n\n## Core Concepts: Wiring, not Programming\n\nThe Bridge is a **Data Topology Language**. You don't write scripts; you wire circuits.\n\n- **Pull, Don't Push:** The engine is strictly lazy. If a client doesn't ask for a specific output field, the wires connected to it are \"dead\"—no code runs, and no external APIs are called.\n- **Cost-Optimized Fallbacks:** The engine knows the difference between a cheap memory read and an expensive network call, automatically evaluating them in the optimal order.\n- **LLM Friendly:** The language is visually distinct and heavily structural, making it incredibly easy for LLMs to generate correct API mappings from standard JSON schemas or OpenAPI specs.\n\n**Don't think in scripts. Think in schematics.**\n\n## Syntax Cheat Sheet\n\nThe `.bridge` language is designed to be scannable.\n\n- `.` prefix means a property.\n- `=` means static constant assignment.\n- `\u003c-` means dynamic data flow.\n\n| Concept           | Syntax Example                 | Description                                                                             |\n| ----------------- | ------------------------------ | --------------------------------------------------------------------------------------- |\n| **Constants**     | `.method = \"POST\"`             | Sets a static configuration value.                                                      |\n| **Wires**         | `.body \u003c- i.userData`          | Pulls data from a source at runtime.                                                    |\n| **Side Effects**  | `force api catch null`         | Eagerly schedules a handle. Critical by default; `catch null` makes it fire-and-forget. |\n| **Pipes**         | `o.name \u003c- uc:i.name`          | Chains data through a tool right-to-left.                                               |\n| **Null Coalesce** | `o.name \u003c- i.name \\|\\| \"N/A\"`  | Alternative used if the current source resolves to `null`.                              |\n| **Error Guard**   | `o.price \u003c- api.price catch 0` | Alternative used if the current source **throws** an exception.                         |\n| **Ternary**       | `o.val \u003c- i.isPro ? a : b`     | Evaluates condition; strictly pulls only the chosen branch.                             |\n| **Node Alias**    | `alias name \u003c- uc:i.name`      | Evaluates an expression once and caches it as a local graph node.                       |\n| **Arrays**        | `o \u003c- items[] as it { }`       | Iterates over an array, creating a local shadow scope for each element.                 |\n\n**[Read the Full Language Guide](https://bridge.sdk42.com/reference/10-core-concepts/)**\n\n## Tools\n\nTo The Bridge engine, everything external is just a \"Tool\". A Tool is simply a JavaScript function that takes a JSON object as input, and returns a JSON object (or Promise) as output.\n\nThe Bridge ships with a standard library (`std`) that includes tools for HTTP requests, array manipulation, and basic string formatting.\n\nYou can inject your own custom tools into the engine in three lines of code:\n\n```typescript\nconst myTools = {\n  // A simple synchronous tool\n  calculateTax: (input) =\u003e ({ total: input.price * 1.2 }),\n\n  // An asynchronous database call\n  fetchUser: async (input) =\u003e await db.users.findById(input.id),\n};\n\n// Standalone mode:\nconst { data } = await executeBridge({\n  instructions,\n  operation,\n  input,\n  tools: myTools,\n});\n\n// Gateway mode:\nconst schema = bridgeTransform(createSchema({ typeDefs }), instructions, {\n  tools: myTools,\n});\n```\n\n**[Read the Tools \u0026 Extensions Guide](https://bridge.sdk42.com/advanced/custom-tools/)**\n\n## Testing Prompt\n\nThe reason we write tests is to catch bugs so we can fix them — not to document broken behavior and ship it.\n\nWe never hide problems or avoid broken scenarios to make tests pass.\n\nIt is always better to not ship and have broken tests than to break our users trust.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackables%2Fbridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackables%2Fbridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackables%2Fbridge/lists"}