clerk-hono

Integrate Clerk authentication into Hono applications to protect routes and expose userId and orgId.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/morgs32/skills --skill clerk-hono
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clerk-hono
Source: https://github.com/morgs32/skills/tree/main/skills/clerk-hono
Command: npx skills add https://github.com/morgs32/skills --skill clerk-hono

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers integrate Clerk authentication into Hono-based applications, enabling route protection and consistent access to userId and orgId in handlers.

Core Features & Use Cases

  • Middleware integration: apply clerkMiddleware() to protected routes to enforce login and session validation.
  • Auth data access: use getAuth(c) in handlers to retrieve userId and orgId and respond accordingly.
  • API key support: optionally verify Clerk API keys for machine-to-machine access and admin operations.
  • Use Case: secure endpoints across typical Hono apps and services that require authenticated user context.

Quick Start

Install the @hono/clerk-auth package, configure Clerk keys in your environment, apply clerkMiddleware to routes, and read authentication data with getAuth in handlers.

Frequently Asked Questions about clerk-hono

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate Clerk authentication into a Hono application?

To integrate Clerk authentication into a Hono application, apply the clerkMiddleware function to protected routes and use getAuth in handlers to retrieve userId and orgId. This enforces login and validates user sessions.

How does middleware protect routes in Hono with Clerk?

Middleware protects Hono routes by applying clerkMiddleware to enforce login and validate sessions before reaching handlers. It ensures only authenticated users can access protected endpoints and securely exposes their auth data.

Can I access orgId and userId inside Hono route handlers?

Yes, you can access userId and orgId inside Hono route handlers by calling getAuth. This function reads the validated authentication context established by the Clerk middleware and makes it available to your handlers.

Does Clerk authentication for Hono support API keys for machine-to-machine access?

Yes, Clerk authentication for Hono supports optional API key verification for machine-to-machine access. You can configure it to verify Clerk API keys specifically for automated operations and admin tasks.

What is the best way to secure endpoints in a Hono web app?

The best way to secure Hono web app endpoints is applying Clerk authentication middleware to enforce login validation and expose user context. This consistently protects routes and retrieves user data across services.

What environment setup is required to use Clerk auth with Hono?

Using Clerk auth with Hono requires installing the @hono/clerk-auth package and configuring your Clerk keys in the environment. This setup allows the middleware to validate sessions and authenticate users properly.