Page cover

codeDevelop your modules

Learn more about developing new modules in Parallelix and how they work in a common bundle

How it Works?

Parallelix uses a modular system in order to provide a single API for different platforms. In essence, each module is a wrapper over the official API or SDK.

  1. The Parallelix client connects modules specified in the configuration by loading additional JS scripts;

  2. After initializing the libraries, it sorts them by priority and calls the IsCurrentPlatform() module on each one

  3. After the required platform is found - its initialization method is called and the client becomes ready to work, providing the required methods with a unified interface

circle-exclamation

Now let's take a look at the structure of the module.


Module Structure

All modules are stored in the directory of your site, which is specified in the Parallelix configuration. From there they will be connected by name.

It is important to respect the naming of your module:

parallelix.YOUR_MODULE_NAME.js

for example:
parallelix.vk.js

All modules are inherited from the base virtual class ParallelixWrapper. Thus, the methods supported by a module can be described, while the rest will cause an exception.

Let's understand the class structure of your new module:

Next, you can create method implementations that will be used for your module on your platform. For this you can refer to the documentation of common classes.


Platform Detection

When discovering a platform, your module must check for certain attributes that a Web application can use to realize that it should currently be using your module.

Also, don't forget to prioritize your module check via the Priority() field. The minimum priority is 0, the maximum is 999.


Publish your Modules

Your help is always welcome. Submit your new modules directly to us on GitHubarrow-up-right. We will be sure to add it to new releases.

Last updated