Core Concepts
Response Normalization
Response Normalization
Consistent data structures across all providers.
Boundary normalizes all API responses into a consistent structure, regardless of the provider. This allows you to write generic logic that works with any supported API.
Response Structure
interface NormalizedResponse<T> {
data: T;
meta: {
status: number;
headers: Record<string, string>;
rateLimit: {
limit: number;
remaining: number;
reset: Date;
};
pagination?: {
next: string | null;
prev: string | null;
total?: number;
};
};
}Type Safety
The
data property is fully typed based on the endpoint you are calling. Boundary uses TypeScript generics to ensure type safety throughout your application.Comparison
Raw GitHub Response
{
"login": "octocat",
"id": 1,
"type": "User",
"site_admin": false
// ... nested mixed casing
}Normalized Response
{
"data": {
"login": "octocat",
"id": 1,
"type": "User"
},
"meta": {
"status": 200,
"rateLimit": {
"remaining": 4999
}
}
}On this page
- Overview