Skip to main content


Initialize Builder

The first step is to initialize the Builder. It manage the basic configuration for connection to the server and all the elements that make up Hyper Fetch, which are instances of - dispatchers, cache and app managers. We start by determining the baseUrl of our server.

import { Builder } from "@hyper-fetch/core";

export const builder = new Builder({ baseUrl: "http://localhost:3000" });

Create Command

Then, having already prepared connection setup for the server, we use the builder method to create commands and assign types to them.


We are using currying to achieve auto generated types for the endpoint string.
This solution will be removed once get resolved.

import { builder } from "../builder.ts";

type ResponseType = { token: string; refreshToken: string };
type RequestType = { email: string; password: string };

const postLogin = builder.createCommand<ResponseType, RequestType>()({ method: "POST", endpoint: "/auth/login" });