Adobe Campaign JavaScript SDK

Passwords

External account passwords can be decrypted using a Cipher. This function is deprecated since version 1.0.0 since it's not guaranteed to work in future versions of Campaign (V8 and above)

const cipher = await client.getSecretKeyCipher();
const password = cipher.decryptPassword(encryptedPassword);

This function is deprecated in version 1.0.0 of the SDK because it may break as we deploy Vault.

In order to set the password of an external account, you can use the encryptPassword API as follow

const password = await this._client.NLWS.xtkSession.encryptPassword('password');
const account = {
    xtkschema: "nms:extAccount",
    name: name,
    account: 'admin',
    server: server,
    password: password,
};
await this._client.NLWS.xtkSession.Write(account);