Metro documentation

Metro documentation

import metro from '@muze-nl/metro'

const client = metro.client('https://jsonplaceholder.typicode.com/')
  .with(metro.mw.json())

const post = await client.get('/posts/1')
console.log(post.data)

Metro is Fetch with a small composable client around it. Use the combined @muze-nl/metro package while learning, then import the smaller packages directly when you want tighter bundles or clearer boundaries.

General docs

Package docs

PackageDocsUse it for
@muze-nl/metrocombined packageOne import, browser global, beginner-friendly API.
@muze-nl/metro-corecoreSmall Fetch-compatible client and helpers.
@muze-nl/metro-middlewaremiddlewareJSON, thrower, retry, timeout, abort, backoff, mocks.
@muze-nl/metro-oauth2OAuth2Authorization-code, PKCE, popup, token storage, DPoP.
@muze-nl/metro-oidcOIDCDiscovery, registration, OIDC auth, ID token validation.
@muze-nl/metro-oldmOLDMLinked Data parsing and writing.
@muze-nl/metro-apiAPI helpersNamed API methods on top of Metro clients.
@muze-nl/metro-tracetraceRequest tracing and console graph diagnostics.
@muze-nl/metro-hashparamshash paramsQuery-like values in location.hash.
@muze-nl/metro-formdataformdataBuild immutable-ish FormData values from objects/forms.