# Extending Ajv
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 - formats defined in JSON Schema specification
- ajv-keywords - additional validation keywords (select, typeof, etc.)
- ajv-errors - defining error messages in the schema
- ajv-i18n - internationalised error messages
- ajv-cli - 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 (
- ajv-merge-patch (opens new window) - keywords $merge and $patch