Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public constructor(options: SearchClientOptions & TransporterOptions) {
this.appId = options.appId;
this.transporter = new Transporter(options);
this.transporter.setHosts(
[
{ url: `${this.appId}-dsn.algolia.net`, accept: Call.Read },
{ url: `${this.appId}.algolia.net`, accept: Call.Write },
].concat(
shuffle([
{ url: `${this.appId}-1.algolianet.com`, accept: Call.Any },
{ url: `${this.appId}-2.algolianet.com`, accept: Call.Any },
{ url: `${this.appId}-3.algolianet.com`, accept: Call.Any },
])
)
);
const auth = new Auth(
options.authMode !== undefined ? options.authMode : AuthMode.WithinHeaders,
this.appId,
options.apiKey
);
this.transporter.addHeaders({