# 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.
# Related packages
- ajv-formats (opens new window) - formats defined in JSON Schema specification
- ajv-keywords (opens new window) - additional validation keywords (select, typeof, etc.)
- ajv-errors (opens new window) - defining error messages in the schema
- ajv-i18n (opens new window) - internationalised error messages
- ajv-cli (opens new window) - command line interface
- ajv-bsontype (opens new window) - MongoDB's bsonType formats
- ajv-formats-draft2019 (opens new window) - formats for draft-2019-09 that are not included in ajv-formats (
idn-hostname
,idn-email
,iri
andiri-reference
) - ajv-merge-patch (opens new window) - keywords $merge and $patch