--- title: "Creating new client instance" slug: "definitions" updated: 2025-12-08T15:43:22Z published: 2025-12-08T15:43:22Z canonical: "docs.xgen.ai/definitions" --- > ## 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. # Creating new client instance Creating a new client instance in XGEN involves initializing the SDK with your API credentials, environment settings, and optional authentication store, giving you a single, reusable connection point for calling services like Search, Recommend, and Tracking throughout your application. These can be found in your [Admin Dashboard](https://app.xgen.ai/admin-dashboard/) ```javascript const xg = new XGenClient({  key: '',  secret: '',  clientId: '',  trackerId: '',  getEnv: () => 'stage', //optional: function that returns the environment (`stage` or `prod`)  authStore: new LocalCookieAuthStore(), //default - can pass in a custom auth store instance  locale: () => "", // returns the locale string for event tracking and will be used for all events.  group: () => "" // returns the current group for tracking to track AB tests }); ```