@shopify/shopify-app-remix
Version:
Shopify Remix - to simplify the building of Shopify Apps with Remix
12 lines (8 loc) • 363 B
text/typescript
const SESSION_TOKEN_PARAM = 'id_token';
export function getSessionTokenHeader(request: Request): string | undefined {
return request.headers.get('authorization')?.replace('Bearer ', '');
}
export function getSessionTokenFromUrlParam(request: Request): string | null {
const url = new URL(request.url);
return url.searchParams.get(SESSION_TOKEN_PARAM);
}