Getting Started
Basic Usage

Basic Usage

Start making resilient, typed API calls with standardized responses.

Making Requests

Access provider clients from the `boundary` instance to make requests.

// GET request
const { data, meta } = await boundary.github.get("/users/octocat");

// POST request
const { data: repo } = await boundary.github.post("/user/repos", {
  name: "new-repo",
  private: true,
});

Standardized Response

All calls return a standardized wrapper object containing `data` and `meta`.

interface BoundaryResponse<T> {
  data: T;          // The typed response body
  meta: {
    status: number; // HTTP status code
    headers: Headers;
    rateLimit?: {
      limit: number;
      remaining: number;
      reset: number;
    };
    source: "network" | "cache";
    retryCount: number;
  };
}