--- title: "SDK Checklist" slug: "sdk-checklist" updated: 2025-12-10T15:33:33Z published: 2025-12-10T15:33:33Z canonical: "docs.xgen.ai/sdk-checklist" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.xgen.ai/llms.txt > Use this file to discover all available pages before exploring further. # SDK Checklist - [ ] ### Step 1 - Setup Experiences - Set up your **XRecommend** and/or **XSearch** Experiences in the XGen Platform - **XRecommend** - Create new experience - Name the experience - Give custom id (optional) - Select **“API Version”** - After the experience is created - Select a **Recommendation Type** - Select a **Merchandising Rule** (if applicable) - **XSearch** - Create a new experience - Name the experience - Select **“API Version”** - After the experience is created - Select a **Search Engine** - Select a **Merchandising Rule** --- - [ ] ### Step 2 - Initialize SDK with Customer Site Information - Initialize SDK with site information. This can be found in the **Admin Dashboard** of the XGen Platform. If you do not have access to the **Admin Dashboard** please contact XGen Customer Support to be given access or to be given the necessary site information. - ![](https://cdn.us.document360.io/ae46ce4b-af2c-4789-b3ad-1d1ccd16b4a1/Images/Documentation/image(87).png) - ```typescript import XGenClient from '@xgenai/sdk-core'; const xg = new XGenClient({ key: 'client-key', secret: 'client-secret', clientId: '123', trackerId: 'client-tracker-id', locale: 'en-us', // or () => 'en-us'; // Globally set for tracking events }); ``` --- - [ ] ### Step 3 - Setup tracking - Tracking is very important for model training and analytics performance reporting. Please refer to [this](/v1/docs/events-summary) document for a high level overview. - [Core Events](/v1/docs/events-summary#core-events) - [XSearch Events](/v1/docs/events-summary#search-events) - [XRecommend Events](/v1/docs/events-summary#recommendations-events) - For a detailed developer guide see [this](/v1/docs/getting-started-guide#setup-event-tracking) document. - All events payloads should be checked and compared with the document above to ensure the correct format is being sent for tracking. --- - [ ] ### Step 4 - Use the Search Service or Recommendation Service - **XSearch** - refer to the [Getting Started Guide](/v1/docs/getting-started-guide#setup-xsearch-if-applicable) for more info - After your **XSearch experience** is all set up, you can now fetch results by passing it in as the `deploymentId` for the `xg.search.getResults()` method - Example: - ```typescript // Returns a search response containing the results const results = await xg.search.getResults({query: 'coat', options: {collection: '', deploymentId:''}}); ``` - **XRecommend** - refer to the [Getting Started Guide](/v1/docs/getting-started-guide#setup-xrecommend-if-applicable) for more info - After your **XRecommend experience** is all set up, you can now fetch results by passing it in as the `elementId` for the `xg.recommend.getResults()` or `xg.recommend.getResultsById()` method - Example: - ```typescript // Returns a recommendation response mapped by element IDs. const results = await xg.recommend.getResults({ elementIds: ['', ''], options: { pathname: '/en-us' } }); // Returns a recommendation response for the given element ID. const results = await xg.recommend.getResultsById({ elementId: '', options: { pathname: '/en-us' } }); ``` --- - [ ] ### Step 5 - Check Cookies - Check that cookie information is remaining consistent throughout page navigations and refreshes and is being sent with events, recommendation requests, and search requests - `xgen_user` : Expires after **395 days** but will continuously be reset as the user keeps coming back to the site. - `xgen_token` : Will expire after **24 hours**. A new token should be set after a call to `xg.search.getResults()` , `xg.recommend.getResults()` , or `xg.recommend.getResultsById()` - `xgen_session` : Will expire after **30 minutes** and a new one will be set. - Check that there is **one** cookie for each of the cookies mentioned above. Make sure that there are not multiple versions of the cookie being set for different domains or paths.