@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
21 lines (18 loc) • 725 B
JavaScript
import { fromAction, AppActionType } from '@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 fromAction("Provided apiKey `".concat(appConfig.apiKey, "` is incorrect. Expecting `").concat(config.apiKey, "`"), AppActionType.INVALID_CONFIG, action);
}
function throwInvalidConfigError(appConfig, config, action) {
throw InvalidConfigError(appConfig, config, action);
}
export { InvalidConfigError, isValidConfig, throwInvalidConfigError };