@shopify/app-bridge-host
Version:
App Bridge Host contains components and middleware to be consumed by the app's host, as well as the host itself. The middleware and `Frame` component are responsible for facilitating communication between the client and host, and used to act on actions se
25 lines (21 loc) • 807 B
JavaScript
;
var Error = require('@shopify/app-bridge-core/actions/Error');
function isValidConfig(appConfig, config) {
if (!appConfig) {
return false;
}
var apiKey = appConfig.apiKey;
if (!apiKey || apiKey !== config.apiKey) {
return false;
}
return true;
}
function InvalidConfigError(appConfig, config, action) {
return Error.fromAction("Provided apiKey `".concat(appConfig.apiKey, "` is incorrect. Expecting `").concat(config.apiKey, "`"), Error.AppActionType.INVALID_CONFIG, action);
}
function throwInvalidConfigError(appConfig, config, action) {
throw InvalidConfigError(appConfig, config, action);
}
exports.InvalidConfigError = InvalidConfigError;
exports.isValidConfig = isValidConfig;
exports.throwInvalidConfigError = throwInvalidConfigError;