static fromTokenCredential()

in src/client.ts [502:515]


  static fromTokenCredential(hostName: string, tokenCredential: TokenCredential, transportCtor?: Client.TransportCtor): Client {
    if (!transportCtor) {
      transportCtor = Amqp;
    }

    const config: Client.TransportConfigOptions = {
      host: hostName,
      keyName: '',
      sharedAccessSignature: undefined,
      tokenCredential,
      tokenScope: 'https://iothubs.azure.net/.default'
    };
    return new Client(new transportCtor(config), new RestApiClient(config, packageJson.name + '/' + packageJson.version));
  }