a6-plugin-serverless

Configure APIServerless pre-function and post- function plugins via a6 CLI with Lua functions for request processing.

1|2|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/api7/a6 --skill a6-plugin-serverless-api7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: a6-plugin-serverless
Source: https://github.com/api7/a6/tree/main/skills/a6-plugin-serverless
Command: npx skills add https://github.com/api7/a6 --skill a6-plugin-serverless-api7

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the integration of lightweight serverless functions into APISIX request processing, enabling quick prototyping and targeted behavior without building full plugins.

Core Features & Use Cases

  • Inline Lua function definitions for pre-function and post-function phases
  • Phase configuration with phase and functions arrays, including compile-time validation
  • Clear execution order and function signatures to ensure predictable behavior across routes and globals
  • Real-world use cases: authentication guards, request/response modification, and dynamic routing decisions

Quick Start

Use the a6 CLI to create a route that applies serverless-pre-function or serverless-post-function with a list of Lua functions.

Frequently Asked Questions about a6-plugin-serverless

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

FAQPage Schema
How do I run inline Lua functions during APISIX request processing?

You can run inline Lua functions in APISIX by configuring the serverless-pre-function or serverless-post-function plugins. This enables route-level pre-processing and post-processing of API traffic without building full plugins.

What is the best way to add a lightweight authentication guard to an APISIX route?

Using APISIX serverless plugins is the best way to add lightweight authentication guards. You define inline Lua functions within the serverless-pre-function plugin to intercept and validate requests during the pre-processing phase.

Can I use the a6 CLI to configure serverless plugins for APISIX?

Yes, you can use the a6 CLI to create routes and configure APISIX serverless plugins. It helps specify required frontmatter metadata, plugin phases, and function strings while ensuring compile-time validation at load time.

How does APISIX execute multiple serverless functions in a specific order?

APISIX executes serverless functions based on the functions array you define, ensuring a clear execution order. The plugin validates function signatures and compiles the Lua code at load time for predictable behavior across routes.

Do I need to build a full APISIX plugin to modify API responses dynamically?

No, you do not need to build a full plugin to modify API responses. You can use the serverless-post-function plugin to run inline Lua functions during the post-processing phase for quick prototyping and targeted behavior.