# Extending Ajv

# Plugins

Ajv can be extended with plugins that add user defined schema keywords, validation formats or functions to process generated code. When such plugin is published as npm package it is recommended that it follows these conventions:

  • it exports a function that accepts ajv instance as the first parameter - it allows using plugins with ajv-cli.
  • this function returns the same instance to allow chaining.
  • this function can accept an optional configuration as the second parameter.

You can import Plugin interface from ajv if you use Typescript.

If you have published a useful plugin please submit a PR to add it to the next section.