In this project, we will add a new plugin to a Nest.js application using a plugin included in the @brewww/authentication-service package.
Run yarn install
command to install all necessary packages required to run the project.
- To run your project.
# development
$ yarn run start
To test your project.
# unit tests
$ yarn run test
# test coverage
$ yarn run test:cov
All tests are expected to pass.
Add the following line to the peerDependencies
section in your package.json
file:
"peerDependencies": {
"@brewww/authentication-service": "^1.1.2"
}
This plugin derives from the BasePlugin
class found in the @brewww/authentication-service
package. It appends Text3
text using appendText
method of PluginTestService
.
Example plugin settings package.json
"authenticationService": {
"name": "text3-appender",
"displayName": "Text3 Appender",
"type": "plugin"
}
-
"name"
: This key contains the value "text3-appender" and specifies the name of the operation that is defined as part of the "authenticationService" object. -
"type"
: This key contains the value "plugin" and specifies that the "authenticationService" object is a plugin. -
"displayName"
: This key contains the value "Text3 Appender" and specifies the name that will be displayed in a user interface for the "authenticationService" object.
Now the plugin is ready to use in your Nest.js application. Launch the application and verify that the plugin is working correctly.
LinkedIn - Twitter - Instagram
Authentication Service Nestjs Sample Plugin is MIT licensed.