Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function main(): Promise {
const credentials = await interactiveLogin({ tokenAudience: "https://eventhubs.azure.net/" });
const client = EventHubClient.createFromAadTokenCredentials(evenHubsEndpoint, eventHubsName, credentials);
/*
Refer to other samples, and place your code here
to send/receive events
*/
await client.close();
}
async function main(): Promise {
const credentials = await loginWithUsernamePassword(username, password, {
tokenAudience: "https://eventhubs.azure.net/"
});
const client = EventHubClient.createFromAadTokenCredentials(evenHubsEndpoint, eventHubsName, credentials);
/*
Refer to other samples, and place your code here
to send/receive events
*/
await client.close();
}