Get started
Install
About five minutes to the first recorded version. The plugin installs two ways, with the same files:
- npm (recommended):
npm updatebrings new versions, and nothing compiled sits in your repository. - The zip: for servers without internet access, or a team that does not want a second registry.
With npm
1. Point npm at the Revisionary registry
Add a .npmrc file at the root of your Strapi project. It holds no key: commit it.
@revisionary:registry=https://getrevisionary.com/npm/2. Save your key for npm, once per computer
npm reads the key from its own configuration, never from your .env. This command saves it in your user configuration (~/.npmrc), the same way in bash, PowerShell and cmd:
npm config set //getrevisionary.com/npm/:_authToken RVSN_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX3. Install the plugin
npm install @revisionary/strapi-plugin4. Add your licence key to .env
Strapi reads it at startup to activate the licence:
REVISIONARY_LICENSE_KEY=RVSN_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX5. Enable the plugin
In config/plugins.ts, enable it and list the content types to version. No resolve line: Strapi finds the plugin in node_modules.
export default () => ({
revisionary: {
enabled: true,
config: {
contentTypes: ['api::article.article', 'api::page.page'],
lockedFields: { 'api::article.article': ['slug'] },
excludedFields: { 'api::article.article': ['internalNotes'] },
cleanupHourUtc: 2,
},
},
});The two uids are examples: put those of your own content types (the Content-Type Builder shows them, in the form api::article.article). A uid this project does not have is ignored, with a warning in the startup log and on the Revisionary home screen.
6. Rebuild and start Strapi
npm run build && npm run developpnpm reads the same files, .npmrc and the key saved by npm config set. Yarn 2 and later read .yarnrc.yml in the project, and keep the key in your home configuration:
npmScopes:
revisionary:
npmRegistryServer: "https://getrevisionary.com/npm/"yarn config set --home npmScopes.revisionary.npmAuthToken RVSN_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXIn CI, store the key as a secret and save it for npm before the install, for example with GitHub Actions:
- run: npm config set //getrevisionary.com/npm/:_authToken "$REVISIONARY_LICENSE_KEY"
env:
REVISIONARY_LICENSE_KEY: ${{ secrets.REVISIONARY_LICENSE_KEY }}
- run: npm ciIn a Docker build, pass it as a build secret and remove it in the same step, so it never stays in an image layer:
COPY package.json package-lock.json .npmrc ./
RUN --mount=type=secret,id=revisionary_key \
npm config set //getrevisionary.com/npm/:_authToken "$(cat /run/secrets/revisionary_key)" \
&& npm ci \
&& npm config delete //getrevisionary.com/npm/:_authTokendocker build --secret id=revisionary_key,env=REVISIONARY_LICENSE_KEY .With the zip
1. Unzip the plugin into your project
Download the zip from your Revisionary account, then unzip it into src/plugins/:
unzip revisionary-1.0.0.zip -d src/plugins/2. Add your licence key
In the .env file of your Strapi project:
REVISIONARY_LICENSE_KEY=RVSN_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX3. Enable the plugin
In config/plugins.ts, enable it and list the content types to version:
export default () => ({
revisionary: {
enabled: true,
resolve: './src/plugins/revisionary',
config: {
contentTypes: ['api::article.article', 'api::page.page'],
lockedFields: { 'api::article.article': ['slug'] },
excludedFields: { 'api::article.article': ['internalNotes'] },
cleanupHourUtc: 2,
},
},
});The two uids are examples: put those of your own content types (the Content-Type Builder shows them, in the form api::article.article). A uid this project does not have is ignored, with a warning in the startup log and on the Revisionary home screen.
You can change the list later from the settings screen: once saved there, the settings stored in the database take over.
4. Rebuild and start Strapi
npm run build && npm run developOpen any entry of a versioned content type. The Version history panel is in the right column, and Revisionary appears in the main menu.