Skip to content
Back to skills

Client Entrypoint

ASecurity

Bind shared entrypoint protocols in a client context with typed call(), invoke(), url(), bindAll(), and bindScreen(). Load when wiring client API routes or screens.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 22, 2026
businessgonodeapifrontend

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 14, 2026

npx -y skills add owlmeans/common --skill client-entrypoint --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Client Entrypoint?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Client Entrypoint
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/owlmeans-client-entrypoint-common/badge)](https://www.skillsdirectory.com/skills/owlmeans-client-entrypoint-common)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: client-entrypoint
description: Bind shared entrypoint protocols in a client context with typed call(), invoke(), url(), bindAll(), and bindScreen(). Load when wiring client API routes or screens.
user-invocable: false
---
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->

# @owlmeans/client-entrypoint

**Install:** `bun add @owlmeans/client-entrypoint@^0.2.0-alpha.0`

Bind a declaration from `@owlmeans/entrypoint`; never construct or replace a contextual
entrypoint by alias.

```ts
import { bind, bindAll, bindScreen } from '@owlmeans/client-entrypoint'

context.registerEntrypoints(bindAll(projectProtocols))
context.registerEntrypoint(bind(projectProtocols.health))
context.registerEntrypoint(bindScreen(projectProtocols.home, handler(Home)))

const value = await context.entrypoint(projectProtocols.create).call({ body })
const { value, outcome } = await context.entrypoint(projectProtocols.create).invoke({ body })
const href = await context.entrypoint(projectProtocols.edit).url({ params: { id } })
```

`bindAll(tree)` flattens a nested named declaration tree while preserving the union of its protocol
types. `bind(protocol)` is appropriate where one protocol must use a distinct client option.
`bindScreen` is for a frontend route and renderer; screens are addressed by `url` and reject
`call`/`invoke`.

`bindScreen` takes a `lazyHandler(...)` result (`@owlmeans/client`) directly, the same as
`handler(Component)`: both return a `RefedEntrypointHandler`, the lazy one also carrying
`.preload()`, so no different wiring is needed. Create it at module scope, never in a render.

```ts
const reports = lazyHandler(() => import('./reports.js'), 'Reports', { fallback: <Spinner /> })
context.registerEntrypoint(bindScreen(projectProtocols.reports, reports))
```

`context.entrypoint(protocol)` derives `ClientProtocolEntrypoint<Protocol>` from the protocol. Do
not add an explicit result generic. `entrypointRef<Request, Response>(alias)` is reserved for a
dynamic remote declaration that cannot be imported.

Client calls include only contract request sections plus `CallOptions` (`auth`, host/port/base,
timeout, signal, `onUploadProgress`/`onDownloadProgress`). `url` accepts params/query plus the same
address options. The route transport is chosen by the declaration; callers do not branch for HTTP,
socket, or queue.

An upload goes to a streamed-body route (`streamBody()` of `@owlmeans/route`, served by
`streamedBody()` of `@owlmeans/server-api`). The body is a `BinaryBody` — a `Blob`/`File`, bytes,
or a Node `Readable` in Bun — sent as is (`/api`); in a browser and in Bun alike:

```ts
const material = await context.entrypoint(materialProtocols.upload).call({
  params: { id }, body: file,
  onUploadProgress: ({ loaded, total }) => setProgress(total != null ? loaded / total : 0),
  timeout: 120_000, signal: controller.signal,
})
```

- A streamed-body route gets no `{}` default body: an absent body stays absent.
- `validateOnCall` validates every section that HAS a schema (`params`, `query`, `body`) and skips a
  streamed route's body; a section the contract left without a schema is never compiled.
- `authMiddleware` (`@owlmeans/auth-common`) still stamps the guard's token on such a call.

`ensureEntrypointFailureService(context)` returns the context-local failure plugin host. Register
an `onFailure` plugin there to observe a rejected remote `invoke`/`call`, show a toast, or collect
diagnostics. Plugins run after the transport fails and the original error is still rethrown to
the caller. This is the opt-in seam for application-wide failure UI; keep the transport independent
of the chosen toast library.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in business →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.