Skip to content
2023 API Summit Hackathon: Experiment with AI for APIs (August 28 - September 27) Learn More →
Kong Logo | Kong Docs Logo
search
  • We're Hiring!
  • Docs
    • Kong Gateway
      Lightweight, fast, and flexible cloud-native API gateway
      Kong Konnect
      Single platform for SaaS end-to-end connectivity
      Kong Mesh
      Enterprise service mesh based on Kuma and Envoy
      decK
      Helps manage Kong’s configuration in a declarative fashion
      Kong Ingress Controller
      Works inside a Kubernetes cluster and configures Kong to proxy traffic
      Insomnia
      Collaborative API development platform
      Kuma
      Open-source distributed control plane with a bundled Envoy Proxy integration
      Docs Contribution Guidelines
      Want to help out, or found an issue in the docs and want to let us know?
  • API Specs
  • Plugin Hub
    • Explore the Plugin Hub
      View all plugins View all plugins View all plugins arrow image
    • Functionality View all View all arrow image
      View all plugins
      Authentication's icon
      Authentication
      Protect your services with an authentication layer
      Security's icon
      Security
      Protect your services with additional security layer
      Traffic Control's icon
      Traffic Control
      Manage, throttle and restrict inbound and outbound API traffic
      Serverless's icon
      Serverless
      Invoke serverless functions in combination with other plugins
      Analytics & Monitoring's icon
      Analytics & Monitoring
      Visualize, inspect and monitor APIs and microservices traffic
      Transformations's icon
      Transformations
      Transform request and responses on the fly on Kong
      Logging's icon
      Logging
      Log request and response data using the best transport for your infrastructure
  • Support
  • Community
  • Kong Academy
Get a Demo Start Free Trial
Kong Gateway
3.0.x
  • Home icon
  • Kong Gateway
  • Kong Plugins
  • About Kong Plugins
github-edit-pageEdit this page
report-issueReport an issue
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Plugin Hub
  • decK
  • Kong Ingress Controller
  • Insomnia
  • Kuma

  • Docs contribution guidelines
  • 3.4.x (latest)
  • 3.3.x
  • 3.2.x
  • 3.1.x
  • 3.0.x
  • 2.8.x
  • 2.7.x
  • 2.6.x
  • Archive (pre-2.6)
enterprise-switcher-icon Switch to OSS
On this pageOn this page
  • What are plugins?
  • Why use plugins?
  • Plugin compatibility with deployment types
  • Precedence
  • Terminology
  • Plugin versioning
    • Kong plugins
    • Third-party plugins
  • Developing custom plugins
  • Contributing custom plugins
  • Other key concepts
You are browsing documentation for an outdated version. See the latest documentation here.

About Kong Plugins

What are plugins?

Kong Gateway is a Lua application designed to load and execute Lua or Go modules, which we commonly refer to as plugins. Kong provides a set of standard Lua plugins that get bundled with Kong Gateway. The set of plugins you have access to depends on your installation: open-source, enterprise, or either of these Kong Gateway options running on Kubernetes.

Custom plugins can also be developed by the Kong Community and are supported and maintained by the plugin creators. If they are published on the Kong Plugin Hub, they are called Community or Third-Party plugins.

Why use plugins?

Plugins provide advanced functionality and extend the use of the Kong Gateway, which allows you to add new features to your implementation. Plugins can be configured to run in a variety of contexts, ranging from a specific route to all upstreams, and can execute actions inside Kong before or after a request has been proxied to the upstream API, as well as on any incoming responses.

Plugin compatibility with deployment types

Kong Gateway can be deployed in a variety of ways, and not all plugins are fully compatible with each mode. See Plugin Compatibility for a comparison.

Precedence

A single plugin instance always runs once per request. The configuration with which it runs depends on the entities it has been configured for. Plugins can be configured for various entities, combinations of entities, or even globally. This is useful, for example, when you want to configure a plugin a certain way for most requests, but make authenticated requests behave slightly differently.

Therefore, there is an order of precedence for running a plugin when it has been applied to different entities with different configurations. The amount of entities configured to a specific plugin directly correlate to its priority. The more entities configured to a plugin the higher its order of precedence is. The complete order of precedence for plugins configured to multiple entities is:

  1. Plugins configured on a combination of a consumer, a route, and a service. (Consumer means the request must be authenticated).
  2. Plugins configured on a combination of a consumer group, service, and a route. (Consumer group means the request must be authenticated).
  3. Plugins configured on a combination of a consumer and a route. (Consumer means the request must be authenticated).
  4. Plugins configured on a combination of a consumer and a service.
  5. Plugins configured on a consumer group and route.
  6. Plugins configured on a consumer group and service.
  7. Plugins configured on a route and service.
  8. Plugins configured on a consumer.
  9. Plugins configured on a consumer group.
  10. Plugins configured on a route.
  11. Plugins configured on a service.
  12. Plugins configured globally.

Terminology

Plugin
An extension to the Kong Gateway, written in Lua or Go.
Kong plugin
A plugin developed, maintained, and supported by Kong.
Third-party or Community plugin
A custom plugin developed, maintained, and supported by an external developer, not by Kong. Kong does not test these plugins, or update their version compatibility. If you need more information or need to have a third-party plugin updated, contact the maintainer by clicking Report an issue in the plugin documentation’s sidebar.
Service
The Kong entity representing an external upstream API or microservice.
Route
The Kong entity representing a way to map downstream requests to upstream services.
Consumer
An entity that makes requests for Kong to proxy. It represents either a user or an external service.
Credential
The API key. A unique string associated with a consumer.
Upstream
The Kong entity that refers to your own API/service sitting behind Kong, to which client requests are forwarded.

Plugin versioning

Each plugin has its own internal versioning scheme. These versions differ from Kong Gateway versions.

Kong plugins

For plugins developed and maintained by Kong, plugin versioning generally has no impact on your implementation, other than to find out which versions of Kong contain which plugin features. Kong plugins are bundled with the Kong Gateway, so compatible plugin versions are already associated with the correct version of Kong.

Third-party plugins

Because third-party plugins are not maintained by Kong and are not bundled with the Kong Gateway, version compatibility is a bigger concern. See each individual plugin’s page for its tested compatibility.

If the versions on the plugin page are outdated, contact the maintainer through the Support link in the plugin documentation’s sidebar.

Developing custom plugins

Kong provides an entire development environment for developing plugins, including Lua and Go SDKs, database abstractions, migrations, and more.

Plugins consist of modules interacting with the request/response objects or streams via a Plugin Development Kit (or PDK) to implement arbitrary logic. Kong provides PDKs for two languages: Lua and Go. Both of these PDKs are sets of functions that a plugin can use to facilitate interactions between plugins and the core (or other components) of Kong.

To start creating your own plugins, check out the PDK documentation:

  • Plugin Development Guide
  • Plugin Development Kit reference
  • Other Language Support

Contributing custom plugins

If you are interested in sharing your custom plugin with other Kong users, you must also submit plugin reference documentation to the Kong Plugin Hub. See the contribution guidelines for adding documentation.

Other key concepts

  • For more information about available plugins, see the Plugin Hub.
  • Stages of software availability
Thank you for your feedback.
Was this page useful?
Too much on your plate? close cta icon
More features, less infrastructure with Kong Konnect. 1M requests per month for free.
Try it for Free
  • Kong
    THE CLOUD CONNECTIVITY COMPANY

    Kong powers reliable digital connections across APIs, hybrid and multi-cloud environments.

    • Company
    • Customers
    • Events
    • Investors
    • Careers Hiring!
    • Partners
    • Press
    • Contact
  • Products
    • Kong Konnect
    • Kong Gateway
    • Kong Mesh
    • Get Started
    • Pricing
  • Resources
    • eBooks
    • Webinars
    • Briefs
    • Blog
    • API Gateway
    • Microservices
  • Open Source
    • Install Kong Gateway
    • Kong Community
    • Kubernetes Ingress
    • Kuma
    • Insomnia
  • Solutions
    • Decentralize
    • Secure & Govern
    • Create a Dev Platform
    • API Gateway
    • Kubernetes
    • Service Mesh
Star
  • Terms•Privacy
© Kong Inc. 2023