@owlmeans/api
v0.1.9
Published
HTTP API client service for OwlMeans client contexts — handles module-based requests with auth token injection.
Readme
@owlmeans/api
HTTP API client service for OwlMeans client contexts — handles module-based requests with auth token injection.
Overview
createApiService(alias?)— creates an HTTP API client serviceappendApiClient(ctx, alias?)— registers the API client in the contextApiClient— the service interface; handlesGET/POST/PUT/DELETErequests- Error classes:
ApiError,ApiClientError,ServerCrashedError,ServerAuthError
Installation
bun add @owlmeans/apiUsage
The API client is registered automatically by @owlmeans/web-client's makeContext. Direct use is only needed for custom setups:
import { appendApiClient } from '@owlmeans/api'
appendApiClient(context)HTTP status constants:
import { OK, CREATED, UNAUTHORIZED_ERROR, NOT_FOUND_ERROR } from '@owlmeans/api'API
createApiService(alias?): ApiClient
Creates an HTTP client service. alias defaults to DEFAULT_ALIAS ('web-client').
appendApiClient<C, T>(ctx, alias?): T
Registers the API client in the context.
Error Classes
ApiError— base API errorApiClientError— client-side request errorServerCrashedError— 5xx responseServerAuthError— 401/403 response
Constants
DEFAULT_ALIAS, OK, CREATED, UNAUTHORIZED_ERROR, NOT_FOUND_ERROR, SERVER_ERROR
Related Packages
@owlmeans/client-module—ClientModule<T>uses this service to make requests@owlmeans/web-client— registers this service viamakeContext
Agent guidance
This package ships embedded Claude Code skills and GitHub Copilot instructions under
agent-meta/. After installing your @owlmeans/* packages, run the OwlMeans
agent-skills installer to place them into your project's native locations
(.claude/skills/ and .github/instructions/):
npx @owlmeans/agent-skillsThe embedded files are version-matched to this package release. Do not edit them directly — they are regenerated on each publish. To contribute guidance edits, open a PR against the source monorepo.
