routes/joy-token
Interfaces
JoyCustomerAccount
The customer-account handle exposed on the Hydrogen route context.
Methods
isLoggedIn()
isLoggedIn(): Promise<boolean>;Returns
Promise<boolean>
query()
query(query, options?): Promise<{
data?: | {
customer?: | {
emailAddress?: | {
emailAddress?: string | null;
}
| null;
firstName?: string | null;
id?: string | null;
lastName?: string | null;
}
| null;
}
| null;
errors?: unknown;
}>;Parameters
| Parameter | Type |
|---|---|
query | string |
options? | unknown |
Returns
Promise<{
data?: | {
customer?: | {
emailAddress?: | {
emailAddress?: string | null;
}
| null;
firstName?: string | null;
id?: string | null;
lastName?: string | null;
}
| null;
}
| null;
errors?: unknown;
}>
JoyTokenContext
The subset of the Hydrogen route context this handler needs.
Properties
customerAccount
customerAccount: JoyCustomerAccount;env
env: JoyTokenEnv;JoyTokenEnv
Private + public env the merchant declares in their Hydrogen project (Oxygen).
Properties
JOY_API_SECRET?
JOY_API_SECRET?: string;PRIVATE — the shop's secretKey. Server-only; never expose to the browser.
JOY_API_URL?
JOY_API_URL?: string;Base URL of the Joy Headless API, e.g. https://api.joy.so/app/api/v1/headless.
JOY_SHOP_DOMAIN?
JOY_SHOP_DOMAIN?: string;The shop's myshopify domain.
JoyTokenLoaderArgs
Structural shape of a Hydrogen/Remix loader's args — only context is used.
Properties
context
context: JoyTokenContext;request?
request?: Request;Functions
loader()
function loader(__namedParameters): Promise<Response>;Hydrogen resource-route loader. Always resolves to a Response; never throws.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | JoyTokenLoaderArgs |
Returns
Promise<Response>