"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
require("@bentley/oidc-signin-tool/lib/certa/certaBackend");
// Sets up certa to allow a method on the frontend to get an access token
const path = require("path");
const bentleyjs_core_1 = require("@bentley/bentleyjs-core");
const config_loader_1 = require("@bentley/config-loader");
const Settings_1 = require("../common/Settings");
const SideChannels_1 = require("../common/SideChannels");
/* eslint-disable no-console */
module.exports = (async () => {
    config_loader_1.loadEnv(path.join(__dirname, "..", "..", ".env"));
    // Need to create a new one on the backend to properly setup dotenv
    const settings = new Settings_1.Settings(process.env);
    // eslint-disable-next-line deprecation/deprecation
    bentleyjs_core_1.Config.App.set("imjs_buddi_resolve_url_using_region", settings.env);
    SideChannels_1.exposeBackendCallbacks();
})();
//# sourceMappingURL=BackendInit.js.map