UNPKG

@trilo/hippopotamus

Version:

Make requests to the Trilo ecosystem

26 lines (25 loc) 801 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Trilo_1 = require("./Trilo"); var constants_1 = require("./constants"); exports.default = (function (config) { try { var obj = typeof window === "undefined" ? Buffer.from(config, "base64").toString("utf-8") : window.atob(config); var _a = JSON.parse(obj), key = _a.key, secret = _a.secret, redirectUri = _a.redirectUri, stage = _a.stage; return new Trilo_1.Trilo({ debug: false, stage: stage || constants_1.PRODUCTION, credentials: { key: key, secret: secret, }, redirectUri: redirectUri, }); } catch (e) { console.error(e); throw e; } });