UNPKG

@shopify/shopify-app-remix

Version:

Shopify Remix - to simplify the building of Shopify Apps with Remix

24 lines (20 loc) 897 B
'use strict'; var errors = require('../../errors.js'); var factory = require('../../clients/storefront/factory.js'); var ensureValidOfflineSession = require('../../helpers/ensure-valid-offline-session.js'); require('../../types.js'); require('@shopify/shopify-api'); function unauthenticatedStorefrontContextFactory(params) { return async (shop) => { const session = await ensureValidOfflineSession.ensureValidOfflineSession(params, shop); if (!session) { throw new errors.SessionNotFoundError(`Could not find a session for shop ${shop} when creating unauthenticated storefront context`); } return { session, storefront: factory.storefrontClientFactory({ params, session }), }; }; } exports.unauthenticatedStorefrontContextFactory = unauthenticatedStorefrontContextFactory; //# sourceMappingURL=factory.js.map