Page cover

Installation and Usage

Learn more about how to install and start using Parallelix in the development of your cross-platform applications

Downloading and Installation

Before you start, download Parallelix libraries from the release page from our official GitHub.

Or clone repository into your project:

git clone https://github.com/Neurosell/parallelix.git

Now connect the main script to work with Parallelix in body tag:

<script type="text/javascript" src="/libraries/parallelix.js"></script>

And start connecting the client in your JS application:

// Configure Parallelix
const client = new Parallelix({
    baseModulesPath: "/libraries/",            // Where your modules located
    supportedPlatforms: ["vk", "telegram"],    // Modules to initialize
    vk: {},                                    // VK Module Config Example
    telegram: {}                               // Telegram Module Config Example
});

// Add Error and Initialization Handler
client.OnError = (error) => {};
client.OnInitialized = (data) => {
    // Work with Parallelix Here
};

// Initialize Client
client.Initialize();

Done. We've got the basic connection sorted out. If you want to learn more about configuration options - visit our section in API Reference


Connect your Modules and Usage

Modules are connected automatically when you specify their name in the Parallelix object configuration. The module name is also contained in the script (parallelix.MODULE_NAME.js).

If you don't need a particular module, you can simply remove it from the configuration.

Once connected and initialized, you are notified that the client is ready for use. This is how you can start using it:

// Your Client Initialization Handler
client.OnInitialized = (data) => {
    // Publish story to social Network
    client.Platform.PublishStory("mediaURL", {
        vk: {
            // Platform Specific Request Parameters from VK Bridge Docs
        },
        telegram: {
            // Platform Specific Request Parameters from Telegram SDK Docs
        }
    }, (data)=> {
        console.log(data);
    }, (error)=> {
        console.error(error.message);
    });
};

Working with Platform-Specific Libraries

You can also plug in platform-specific scripts, for example, using two different ad networks or analytics systems on different platforms.

To do this, specify these libraries and the platform on which they should be connected in the Parallelix client configuration:

// Configure Parallelix
const client = new Parallelix({
    // Add Platform Specific Libraires
    specificLibraries: [
        { platform: "vk", script: "https://example.com/script_only_vk.js" },
        { platform: "telegram", script: "https://example.com/script_only_telegram.js" }
    ],
    
    // You Basic Config
    baseModulesPath: "/libraries/",            // Where your modules located
    supportedPlatforms: ["vk", "telegram"],    // Modules to initialize
    vk: {},                                    // VK Module Config Example
    telegram: {}                               // Telegram Module Config Example
});

API Reference

So, you have learned the main points on connecting and basic use of Parallelix. Let's start reviewing the API itself and its methods.

Last updated