@xtandard/entitlements/bun
Bun adapter: entitlementsPanel() returns the web-standard panel handler to
hand to Bun.serve({ fetch }), and requireEntitlement() guards a route
handler (402 / 403 JSON for denials).
import { … } from "@xtandard/entitlements/bun";Functions
Section titled “Functions”| Name | Summary |
|---|---|
entitlementsPanel |
Create a Bun-ready panel handler (fetch + engine + openapi). |
requireEntitlement |
Guard a Bun route: resolve the customer from the Request, check (or consume) feature, answer 402 / 403 JSON when denied (401 when no customer), otherwise call the handler with the decision. Returns a wrapper to apply to handlers. |
Type aliases
Section titled “Type aliases”| Name | Summary |
|---|---|
GuardedBunHandler |
A Bun route handler that also receives the allowing decision. |
Re-exports
Section titled “Re-exports”| Name | Documented on |
|---|---|
CreateFetchHandlerResult |
@xtandard/entitlements |
EntitlementsPanelOptions |
@xtandard/entitlements |
RequireEntitlementOptions |
@xtandard/entitlements |