📦 FetchPoliciesResult Type
The result returned by getPolicies() provides a standardized response structure, including published policy data and error handling.
type FetchPoliciesResult = {
data: PolicyEntry[];
pageInfo: null;
error: string | null;
};
🛍️ data
An array of PolicyEntry objects describing the returned policies.
Each entry has the following shape:
type PolicyEntry = {
type: string;
title: string;
handle: string;
id: string;
published: boolean;
from: "shop" | "page";
url?: string;
};
type: A unique key (e.g."privacyPolicy","legalNotice")title: Title of the policyhandle: URL handle (used in links or routing)id: Shopify resource IDpublished: Whether the policy has body contentfrom: Source of the policy, either'shop'(native) or'page'(custom)url: Only available for native policies via the Storefront API
🔁 pageInfo
Always null for this function.
This value exists only for compatibility with other SDK functions like getCollection() that support pagination.
❌ error
If the policy fetch process fails or a policy page is not found, this will be a string message.
Otherwise, it will be null.
error: null;
Description
Type definition for the result object returned by getPolicies().