Repository navigation
Conversation
…point
Calls GET /recommendations/v1/pages/{page_id}. Shared parameters use the
same wire format as getRecommendations; podOverrides are sent as
pod_overrides[<pod_id>][<param>] in bracket notation.
Each pod's own result_id is stamped onto that pod's results. The
top-level result_id identifies the page request and is not a tracking id.
getRecommendations URL and headers are unchanged; the session/user query
parameters and request headers are built by shared helpers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
recommendations.getRecommendationPage(pageId, parameters, userParameters, networkParameters)forGET /recommendations/v1/pages/{page_id}(API reference), for server-rendered integrations. A page returns every pod configured on it in one request, deduplicated across pods server-side.What it does
Shared parameters:
itemIds,variationId,section,term,numResults,filters,filterMatchTypes,preFilterExpression,fmtOptions,hiddenFields,variationsMap, plus the usualuserParameters(session, client, user, segments, origin referrer, user IP/agent headers) and the security token header.podOverrides: { [podId]: { numResults, filters, filterMatchTypes, preFilterExpression, fmtOptions, hiddenFields, variationsMap } }is sent in bracket notation, e.g.pod_overrides[complete_the_look][filters][color]=red. Each value uses the same wire format as the top-level param:pre_filter_expressionandvariations_mapare JSON strings. An override replaces the page-wide value for that pod. Page-wide keys inside an override are rejected client-side.Tracking: per-pod
result_id. Each pod's ownresult_idis stamped onto that pod's results. The top-levelresult_ididentifies the page request and is not a tracking id: sendresponse.pods[].result_idwith each pod's recommendation view/click events.Like
getRecommendations, the returned promise exposesrequestUrl.Types:
RecommendationPageParameters,RecommendationPagePodOverride,RecommendationPageResponse,RecommendationPagePod.fmt_optionsreplace semantics:hiddenFieldsis sent insidefmt_options, and an override replaces the page-wide value wholesale. So an override that sets onlyhiddenFieldsdrops the page-widefmtOptionsfor that pod, and vice versa.Back-compat
getRecommendationsis unchanged. Its user query params and headers now come from shared helpers. I compared URL + headers fromorigin/masterand this branch on the same inputs, and they are identical apart from_dt. Nodocs/or version changes.Testing
npm run lint: no errors (1 pre-existingno-consolewarning in a catalog spec)npm run test:types(tsd): passes, with new page type testspod_overrides(array filters,num_results=0, JSONpre_filter_expression/variations_map, fmt_options + hiddenFields), per-podresult_idstamping (page id never used),requestUrl, and the rejections.**/*.js): cleandescribe.skip('getRecommendationPage - live'). The page endpoint is not yet enabled on the test index, and the test index has no page configured (/recommendations/v1/pages/pdp_b2creturns 404).Blocked / follow-ups
🤖 Generated with Claude Code