@owlmeans/client-context
v0.1.7
Published
Client-side context factory extending `BasicContext` with API client and service routing.
Readme
@owlmeans/client-context
Client-side context factory extending BasicContext with API client and service routing.
Overview
makeClientContext(cfg)creates a client context with HTTP API client pre-configured- Adds
ClientContextcapabilities: service URL resolution, API route calls - Base for higher-level context factories (
@owlmeans/web-client'smakeContext) - Usually not used directly — use
makeContextfrom your platform-specific package
Installation
bun add @owlmeans/client-contextUsage
Typically called through a higher-level factory:
// Via @owlmeans/web-client
import { makeContext } from '@owlmeans/web-client'
const context = makeContext(appConfig)Direct usage:
import { makeClientContext } from '@owlmeans/client-context'
const context = makeClientContext(clientConfig)API
makeClientContext<C, T>(cfg): T
Creates a client context configured for API calls.
ClientContext<C>
Extends BasicContext<C> with:
- Service URL resolution for configured service routes
Related Packages
@owlmeans/context—BasicContextbase@owlmeans/web-client— wraps this with React Router integration@owlmeans/client-config—addWebServicefor service URL config
