Updated NodeJS Session Code

I run the following code and nothing happens. I am having a really hard time finding any up-to-date documentation on how to use the new kaltura-client for NodeJS. It seems this client has changed a lot over the years. I would really like to know how I can get error handling from this to see what is going wrong as well. Nothing prints out to the console when I run this.

require('dotenv').config();

const kaltura = require('kaltura-client');

const config = new kaltura.Configuration();

const proxyUrl = new URL('process.env.PROXY');

proxyUrl.username = process.env.USERNAME;

proxyUrl.password = process.env.PASSWORD;

config.proxy = proxyUrl.toString();

let client = new kaltura.Client(config);

kaltura.services.session.start(process.env.ADMIN_SECRET,

    process.env.USER_EMAIL,

    kaltura.enums.SessionType.ADMIN,

    process.env.PARTNER_ID,

    315569520).completion((success, ks) => {

    console.log(success);

    console.log(ks);

    client.setKs(ks);

});

Hello @zane_schepke,

Below is a code sample for session.start().

Please note that developer.kaltura.com includes both an interactive console from which you can make any API request as well as a code generator that will produce ready to use code for all our supported clients, NodeJS included. For example, see:

https://developer.kaltura.com/console/service/session/action/start

const kaltura = require('kaltura-client');
const config = new kaltura.Configuration();
config.serviceUrl = 'https://www.kaltura.com';
const client = new kaltura.Client(config);
let secret = "ADMIN_SECRET"
let userId = "USER_ID";
let type = kaltura.enums.SessionType.ADMIN;
let partnerId = PARTNER_ID;
let expiry = 86400;
let privileges = "";

kaltura.services.session.start(secret, userId, type, partnerId, expiry, privileges)
.execute(client)
.then(result => { 
    console.log(result);
});

Cheers,