UNPKG

@shopify/shopify-app-remix

Version:

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

31 lines (25 loc) 778 B
import {shopifyApp} from '../shopify-app'; import {APP_URL, BASE64_HOST, TEST_SHOP} from './const'; import {getJwt} from './get-jwt'; import {setUpValidSession} from './setup-valid-session'; import {testConfig} from './test-config'; export async function setUpEmbeddedFlow() { const shopify = shopifyApp({ ...testConfig(), future: { unstable_newEmbeddedAuthStrategy: false, }, }); const expectedSession = await setUpValidSession(shopify.sessionStorage); const {token} = await getJwt(); const request = new Request( `${APP_URL}?embedded=1&shop=${TEST_SHOP}&host=${BASE64_HOST}&id_token=${token}`, ); const result = await shopify.authenticate.admin(request); return { shopify, expectedSession, ...result, request, }; }