Skip to main content
Develop your first Bridge API

The Typescript API framework that boosts developer productivity

Bridge is a strongly typed framework that auto-generates the OpenAPI specification and fully-typed Typescript client code, without schema or .

~ npx create-bridge-app
Simplicity

Bridge offers an easy and scalable way to write your backend code.

Create an endpoint

Validate your data

Add middlewares

Experience the power of TS

index.ts
import { initBridge, handler, apply, httpError } from 'bridge';
import z from 'zod'
const authMid = handler({
   headers: z.object({ token: z.string() }),
   resolve: (data) => {
(parameter) data: {
  headers: {
    token: string;
  };
}
     if (data.headers.token !== 'private_token') 
        return httpError(401, 'Wrong token');
      else return { name: 'John Doe' };
    },
})
const getMe = handler({
   body: z.object({ pseudo: z.string().min(3) }),
   middlewares: apply(authMid),
   resolve: () => 'Hello!'
(parameter) data: {
  body: {
    pseudo: string;
  };
  mid: {
    name: string;
  };
  headers: {
    token: string;
  };
}
   resolve: (data) => `Hey ${data.body.pseudo}`
})
const bridge = initBridge({ routes: { getMe } });

bridge.HTTPServer().listen(8080, () => {
    console.log("Listening on port 8080"); 
});

Never write HTTP requests again

Use your server's route like functions.

Goodbye Postman collections

The client SDK contains all the information necessary to integrate and use correctly your API.

Easily maintain and update your code

After an update, the IDE alerts developers of changes that happened in the API, and identifies where changes need to be made in the client code.

|

Made for many different languages

Generate SDKs in many different languages for your apps or microservices. Contact us on Discord to add a specific language.

Have an auto-generated client SDK using one command line

Type-safe request parameters

Never make mistakes while calling your endpoints.

Easily handle incoming errors

It has never been that easy to handle errors.

Type-safe request response

Never make mistakes while using your endpoints response.

import { API } from "./sdk"
const { data, error } = await API.user.get({
body: {
}
})
if (error) {
switch (error.name) {
//...
break;
}
}
name
string
id
number
|
Document not found
Body schema validation error
Internal server error
Wrong permission
|
id
number
name
string
age
number
|

Have an auto-generated documentation without writing any metadata.

Try it yourself!

Try out Bridge without leaving your browser!

Bridge is getting better every day —
don’t miss out anything.

Join the Bridge newsletter and stay updated on new releases, features and guides.

Join our Discord