smithery.ai

libweb

libweb - Web extension utilities. authMiddleware validates JWT tokens. corsMiddleware handles cross-origin requests. validationMiddleware validates request bodies against JSON schema. createAuthMiddleware, createCorsMiddleware, createValidation are factories for customization. Use for securing HTTP APIs, request validation, and CORS handling with Hono framework.

First seen Apr 7, 2026

Installation

$ npx skills add https://smithery.ai

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Declared agents github-copilot

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,463 B
  • docs SUMMARY.md 378 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

libweb Skill

When to Use

  • Adding authentication to HTTP endpoints
  • Configuring CORS for API access
  • Validating request payloads
  • Building secure REST APIs with Hono

Key Concepts

authMiddleware: Validates JWT tokens from Authorization header.

corsMiddleware: Handles preflight requests and CORS headers.

validationMiddleware: Validates request body against JSON schema.

Usage Patterns

Pattern 1: Secure endpoint

import { authMiddleware, corsMiddleware } from "@copilot-ld/libweb";

app.use(corsMiddleware({ origins: ["http://localhost:3000"] }));
app.use("/api/*", authMiddleware(authConfig));

Pattern 2: Validate requests

import { validationMiddleware } from "@copilot-ld/libweb";

const schema = {
  type: "object",
  required: ["message"],
  properties: { message: { type: "string", maxLength: 1000 } },
};

app.post("/api/chat", validationMiddleware(schema), handler);

Integration

Used by Web and API extensions. Works with Hono framework middleware pattern.