inai-express-sdk

Integrate InAI Auth into Express apps with middleware and RBAC.

Updated Mar 14, 2026
One-click install
npx skills add https://github.com/InAI-Team/inai-auth-skills --skill inai-express-sdk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: inai-express-sdk
Source: https://github.com/InAI-Team/inai-auth-skills/tree/main/skills/inai-express-sdk
Command: npx skills add https://github.com/InAI-Team/inai-auth-skills --skill inai-express-sdk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Integrate InAI Auth into Express applications to provide authentication, middleware protection, and RBAC with a cohesive API surface.

Core Features & Use Cases

  • Middleware: inaiAuthMiddleware for global authentication and route protection with customizable public routes.
  • API routes: createAuthRoutes() mounted at /api/auth, covering login, register, MFA, refresh, and logout.
  • Access control: requireAuth() for protected routes, getAuth() for manual checks, and support for app and platform auth modes.

Quick Start

Install the @inai-dev/express package and wire inaiAuthMiddleware and createAuthRoutes() in your Express app to enable authentication.

Frequently Asked Questions about inai-express-sdk

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

FAQPage Schema
How do I add authentication and RBAC middleware to an Express application?

Express authentication and RBAC integration uses inaiAuthMiddleware for global protection and requireAuth() for individual secured routes. This setup delivers login, registration, MFA, and session management across your Node.js API endpoints.

How does Express middleware handle MFA and session management with JWKS?

MFA and session management in Express middleware applies cookies and JWKS-based ES256 verification. The createAuthRoutes() function mounts API endpoints at /api/auth to process login, register, MFA, refresh, and logout workflows.

Can I customize public routes when setting up Express authentication middleware?

Customizing public routes in Express authentication middleware is supported by inaiAuthMiddleware. This allows specific endpoints to remain openly accessible while strictly enforcing requireAuth() and getAuth() checks on protected API paths.

What is the difference between app mode and platform mode in Express auth integration?

App mode and platform mode in Express auth integration define the operational scope for authentication and RBAC enforcement. Both modes utilize getAuth() for manual checks and requireAuth() for route protection across different deployment contexts.

Do I need any external dependencies to configure InAI Auth in my Node.js API?

Configuring InAI Auth in a Node.js API requires zero external dependencies. You only need to install the @inai-dev/express package and wire inaiAuthMiddleware and createAuthRoutes() into your existing Express application to enable authentication.