Using Addons
Hizzy can be extended using addons which adds new functionalities to Hizzy!
Adding an Addon
To use an addon, it needs to be added to the devDependencies
(or dependencies
) of the project's package.json
and the name should be included in the addons
array in the config file.
For example if you wanted to use the @hizzyjs/authentication
addon, you would first run this to put it into the package.json
file:
npm install -D @hizzyjs/authentication
Then you would add the @hizzyjs/authentication
to the addons
array in the config file:
{
...
"addons": [
"@hizzyjs/authentication"
],
...
}
Using an addon
Addons can have both a server-sided and client-sided API.
You can import the addon like this from server-side:
import MyAddon from "addon-name-here";
You can import the addon like this from client-side:
import MyAddon from "addon-name-here";
OR like this:
import {useAddon} from "hizzy";
const MyAddon = useAddon("addon-name-here");
Official Addons
Check out the Official Addons.
Community Addons
You can submit a PR to list your addons here.
Creating Addons
Check out the Addons API Guide for documentation about creating addons.