@stripe/ui-extension-sdk
Version:
The suite of functionality available to UI extensions in Stripe apps
21 lines • 918 B
JavaScript
;
/**
* Private! This allows the shared endpoint to be intialized
* so that the SDK can communicate with the Dashboard.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHostEndpoint = void 0;
const invariant_1 = __importDefault(require("invariant"));
const getHostEndpoint = () => {
var _a;
// This is endpoint is created from the MessagePort transferred from the host env
// as a part of the `init_extension` message.
const hostEndpoint = (_a = globalThis.__StripeExtExports) === null || _a === void 0 ? void 0 : _a.endpoint;
(0, invariant_1.default)(hostEndpoint, 'hostEndpoint has not been initialized');
return hostEndpoint;
};
exports.getHostEndpoint = getHostEndpoint;
//# sourceMappingURL=_endpoint.js.map