Is there anything more to using API Secrets with `...
# suitescript
e
Is there anything more to using API Secrets with
N/sftp
than this?
Copy code
let passwordSecretID = 'custsecret_test_password';
            try {
                const connection = sftp.createConnection({
                    username: 'demo',
                    secret: passwordSecretID, // Is 'password' in the secret for <http://test.rebex.net|test.rebex.net>
                    url: '<http://test.rebex.net|test.rebex.net>',
                    port: 22,
                    hostKeyType: 'rsa',
                    hostKey: `AAAAB3NzaC1yc2EAAAABJQAAAQEAkRM6RxDdi3uAGogR3nsQMpmt43X4WnwgMzs8VkwUCqikewxqk4U7EyUSOUeT3CoUNOtywrkNbH83e6/yQgzc3M8i/eDzYtXaNGcKyLfy3Ci6XOwiLLOx1z2AGvvTXln1RXtve+Tn1RTr1BhXVh2cUYbiuVtTWqbEgErT20n4GWD4wv7FhkDbLXNi8DX07F9v7+jH67i0kyGm+E3rE+SaCMRo3zXE6VO+ijcm9HdVxfltQwOYLfuPXM2t5aUSfa96KJcA0I4RCMzA/8Dl9hXGfbWdbD2hK1ZQ1pLvvpNPPyKKjPZcMpOznprbg+jIlsZMWIHt7mq2OJXSdruhRrGzZw==`
                });
                if (connection) {
                    log.debug('CONNECTION', connection);
                    scriptContext.response.write('CONNECTION SUCCESSFUL');
                }
            } catch (e) {
                scriptContext.response.write(`CONNECTION FAILED:<br \>`);
                scriptContext.response.write(e.message);
                return null;
            }
b
code looks fine
k