๐งพ GetPoliciesOptions Type
The options object for getPolicies() lets you customize how and which policies are fetched from your Shopify store.
type GetPoliciesOptions = {
language?: string;
customHandles?: Record<string, string>;
policyTypes?: PolicyType[];
debug?: boolean;
};
๐ languageโ
Set the desired language for fetching native policies.
It affects the body and url fields (when translated content is available).
language: "fr";
๐ ๏ธ customHandlesโ
Map of custom policy keys to Shopify Page handles.
Overrides native policies and adds support for non-native ones.
customHandles: {
legalNotice: "mentions-legales",
termsOfSale: "conditions-generales-de-vente",
}
Use this to fetch policies like legalNotice, cookiePolicy, or contactInfo not available via the Storefront API.
๐ฏ policyTypesโ
List of policies to include in the result.
Defaults to all native types plus any in customHandles.
policyTypes: ["privacyPolicy", "refundPolicy", "legalNotice"];
If not specified, this is auto-generated by merging default native types with the keys in customHandles.
๐ debugโ
Log helpful warnings and override notices to the console.
debug: true;
Ideal during development or when diagnosing Shopify quirks.
โ Next: Result Type โ
Description
Type definition for the options object used in getPolicies.