How to install/update plugin from plugin?

Hi! How can i update or install plugins from js code?
There are docs for UpdatePlugin and InstallPlugin, but what to pass as params?

I tried few ways (passing link to config.json on disc, passing link to .plugin file, passing config object) and it always returns {type: 'Updated', guid: ''} or true, but nothing happens.

Also, what is the difference between " InstallDeveloperPlugin" and " InstallPlugin"? Docs descriptions are the same.

Editor version - 7.4

Hello @scoolnik
Please take a look at these more specific pages with samples:

Please let us know if you face any issues.

As for the difference between " InstallDeveloperPlugin" and " InstallPlugin", I’ll check it out and come back to you shortly.

1 Like

Dear @scoolnik
The InstallDeveloperPlugin method will be deprecated soon. As for the InstallPlugin method, here’s a sample for your reference:

        var plugin_url = 'http://url/plugin/config.json'

        fetch(plugin_url)
            .then((response) => {
                if (!response.ok) {
                    throw new Error(`HTTP error! Status: ${response.status}`);
                }
                return response.json(); // Parse JSON response
            })
            .then((data) => {
                console.log('Fetched JSON:', data); // Use the JSON data
                window.Asc.plugin.executeMethod ("InstallPlugin", [data], function (result) {
                    postMessage (JSON.stringify (result));
                });
            })
            .catch((error) => {
                console.error('Error fetching JSON:', error);
            });

Please pay attention that you need to specify base URL parameter:

{
    "name"       : "some plugin name",
    "guid"       : "asc.{0616AE85-5DBE-4B6B-A0A9-455C4F1503AA}",
    "baseUrl"    : "http://url/plugin/",
    "variations" : [
1 Like