import SupportedBrowser from "./SupportedBrowser"; export class BrowserstackApi { private readonly _baseUrl: string = 'https://api.browserstack.com/5'; private readonly _authorizationHeader: string; constructor(username: string, accessKey: string) { this._authorizationHeader = `Basic ${Buffer.from(`${username}:${accessKey}`).toString('base64')}`; } public async getSupportedBrowsers(): Promise { const response = await fetch(`${this._baseUrl}/browsers?flat=true`, { headers: { 'Authorization': this._authorizationHeader } }); return response.json() as Promise; } }