Skip to content

API quick start ​

Read a saved deployment with the original jsbrains SDK. The optional normalized-profile bridge has its own quick start. This example uses synthetic settings on the host and does not connect to a server.

Install ​

sh
npm install @jalsoedesign/jsbrains

Use Node.js 20 or newer for the original SDK. Follow language setup for TypeScript tooling and JavaScript module configuration.

Save the fixture ​

Save PhpStorm2026.2/options/webServers.xml at the shown path.

Fixture contents
xml
<application>
    <component name="WebServers">
        <option name="servers">
            <webServer id="demo" name="Demo">
                <fileTransfer accessType="SFTP" host="127.0.0.1" port="22" username="deploy" />
            </webServer>
        </option>
    </component>
</application>

Save PhpStorm2026.2/options/sshConfigs.xml at the shown path.

Fixture contents
xml
<application>
    <component name="SshConfigs">
        <configs>
            <sshConfig id="demo-ssh" host="127.0.0.1" port="22" username="deploy" authType="OPEN_SSH" />
        </configs>
    </component>
</application>

Create the PhpStorm2026.2/options directories first.

Read the settings ​

Save the selected language tab as read-deployments.ts or its matching variant, beside the fixture directory.

ts
// read-deployments.ts
import {JetBrains} from '@jalsoedesign/jsbrains';

const installation = await JetBrains.fromConfigPath(process.argv[2] ?? './PhpStorm2026.2');
const deployments = await installation.getGlobalDeployments();

console.log('Deployments: ' + deployments.length);

for (const deployment of deployments) {
    console.log(deployment.name + ': ' + deployment.type + ' ' + deployment.host + ':' + deployment.port);
}

console.log('Metadata only: no server connection or Password Safe unlock.');
js
// read-deployments.js
import {JetBrains} from '@jalsoedesign/jsbrains';

const installation = await JetBrains.fromConfigPath(process.argv[2] ?? './PhpStorm2026.2');
const deployments = await installation.getGlobalDeployments();

console.log('Deployments: ' + deployments.length);

for (const deployment of deployments) {
    console.log(deployment.name + ': ' + deployment.type + ' ' + deployment.host + ':' + deployment.port);
}

console.log('Metadata only: no server connection or Password Safe unlock.');
js
// read-deployments.mjs
import {JetBrains} from '@jalsoedesign/jsbrains';

const installation = await JetBrains.fromConfigPath(process.argv[2] ?? './PhpStorm2026.2');
const deployments = await installation.getGlobalDeployments();

console.log('Deployments: ' + deployments.length);

for (const deployment of deployments) {
    console.log(deployment.name + ': ' + deployment.type + ' ' + deployment.host + ':' + deployment.port);
}

console.log('Metadata only: no server connection or Password Safe unlock.');
js
// read-deployments.cjs
async function main() {
    const {JetBrains} = await import('@jalsoedesign/jsbrains');

    const installation = await JetBrains.fromConfigPath(process.argv[2] ?? './PhpStorm2026.2');
    const deployments = await installation.getGlobalDeployments();

    console.log('Deployments: ' + deployments.length);

    for (const deployment of deployments) {
        console.log(deployment.name + ': ' + deployment.type + ' ' + deployment.host + ':' + deployment.port);
    }

    console.log('Metadata only: no server connection or Password Safe unlock.');
}

main().catch(error => {
    console.error(error);
    process.exitCode = 1;
});

Run it ​

sh
npx tsx read-deployments.ts
sh
node read-deployments.js
sh
node read-deployments.mjs
sh
node read-deployments.cjs

Output ​

text
Deployments: 1
Demo: sftp 127.0.0.1:22
Metadata only: no server connection or Password Safe unlock.

Download: TypeScript · JavaScript · MJS · CommonJS

Continue by task ​

Read deployments and settings, explore discovery, or use normalized profiles and writing. Validation, unsupported settings and source lifetimes are explained in the corresponding guides and API reference.