Can't handle StreamId of an user created

Hi,
After publish the new user, I can’t handle the streamId that was created. Why?

Here’s my code:

const properties = this.openViduWebRTCService.createPublisherProperties(true, true, true, true, true, ‘APPEND’);

var newPublisher = this.openViduWebRTCService.initPublisher(undefined, properties);
this.session.publish(newPublisher);

console.log('newPublisher: ', newPublisher.stream.streamId); // Return undefined
console.log('newPublisher: ', this.session.connection.stream.streamId); // Return undefined

Someone can help me?

You must wait for the Session.publish operation to complete. It is asynchronous. Wait for the promise, and everything will be properly initialized and defined.