"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = getAccessToken;
const constants_1 = require("./constants");
async function getAccessToken(request, accessKeyId, apiSecret) {
    const res = await request(`${constants_1.M3TER_AUTH_API}/oauth/token`, {
        method: 'POST',
        body: '{"grant_type":"client_credentials"}',
        headers: {
            authorization: `Basic ${Buffer.from(`${accessKeyId}:${apiSecret}`).toString('base64')}`,
            'Content-Type': 'application/json'
        }
    });
    return res.data.access_token;
}
//# sourceMappingURL=auth.js.map