Skip to main content

Edge-bridge drivers

The edge bridge is a small service you run at your location for the cases where Cobblr can't reach a machine directly (see Digital fabrication for when that is). A driver is the piece that teaches the bridge one machine, and you can write your own.

What a driver is

A driver is a single default export: a DriverPackage with a kind, a name, and a createDriver factory that returns something implementing the bridge's driver interface (list devices, upload a file, start a job, report status). The bridge loads it by npm name or local path and runs it like a built-in.

Drivers can live in their own repo or package, so you can write one for a machine we don't cover, keep it private, or ship it in your own product. Under MIT, that's your call.

Start from the template

A driver is one exported DriverPackage object: a kind (your driver's id), a name, an apiVersion, and a createDriver function that returns the methods for your machine. The MIT-licensed driver template ships alongside the bridge as a fully stubbed package with TODOs where the machine logic goes; rename it and fill in the methods. The built-in drivers are good references: each splits pure protocol logic, which you can unit-test with no hardware, from the actual I/O.

Installing your driver

Publish it or point the bridge at a local path, reference it in the bridge config's drivers: list, and give an instance its kind. The bridge registers it and runs it next to the built-ins.