1

I currently use version 1 of kuzzle and i will be using version 2. I have a problem because i have overloaded the back part with a plugin (declared in the enabled folder in V1). However in v2 i do not see where to declare the plugins. I are successful in loading it into the docker but when launching kuzzle it is not taken into account.

I have use this : "bash -c "$(curl https://get.kuzzle.io)"" to install kuzzle V2.

If I can be more explicit in my request: Where should we declare a plugin so that it is taken into account when launching kuzzle? In version 1 of kuzzle it was enough to declare the plugins in an "enabled" folder.

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 21 '21 at 05:08

1 Answers1

1

Since Kuzzle v2, the code is very similar to a classic Node.js Framework.

First you need to create an app.ts file and instantiate the application inside. (I will use Typescript in this example but it also works with plain Javascript)

import { Backend } from 'kuzzle';

const app = new Backend('my-application');

app.start();

In Kuzzle v1 (but also in v2), plugins are defined as a class. You can use require to load that class, instantiate it and then tell the framework to use the plugin:

const myPlugin: any = require('./my/plugin/dir');

app.plugin.use(myPlugin);

You can use the kourou app:scaffold command to create an empty Kuzzle v2 application. Then just add your Kuzzle v1 plugin directory and load it from the app.ts file.

Additional links:

Aschen
  • 1,691
  • 11
  • 15