# General Translation Platform: GTConstructorParams URL: https://generaltranslation.com/en-US/docs/platform/core/reference/types/gt-constructor-params.mdx --- title: GTConstructorParams description: Configuration options accepted by the GT constructor. API reference for GTConstructorParams type. --- `GTConstructorParams` defines the configuration options accepted by the General Translation [Constructor](/docs/platform/core/reference/gt-class/constructor) when initializing a [`GT`](/docs/platform/core/reference/gt-class/constructor) instance. ## Overview [#overview] All properties are optional. When `apiKey`, `devApiKey`, and `projectId` are not provided, the constructor reads them from the `GT_API_KEY`, `GT_DEV_API_KEY`, and `GT_PROJECT_ID` environment variables. ```typescript type GTConstructorParams = { apiKey?: string; devApiKey?: string; sourceLocale?: string; targetLocale?: string; locales?: string[]; projectId?: string; baseUrl?: string; customMapping?: CustomMapping; }; ``` *Note:* the older docs typed this as an `interface`; the current source defines it as a `type` alias. ## Properties [#properties] | Property | Description | Type | Optional | | --- | --- | --- | --- | | [`apiKey`](#api-key) | Production API key. | `string` | Yes | | [`devApiKey`](#dev-api-key) | Development API key. | `string` | Yes | | [`sourceLocale`](#source-locale) | Default source locale. | `string` | Yes | | [`targetLocale`](#target-locale) | Default target locale. | `string` | Yes | | [`locales`](#locales) | Supported locale codes. | `string[]` | Yes | | [`projectId`](#project-id) | Project identifier. | `string` | Yes | | [`baseUrl`](#base-url) | Custom API endpoint. | `string` | Yes | | [`customMapping`](#custom-mapping) | Custom locale mappings. | [`CustomMapping`](/docs/platform/core/reference/types/custom-mapping) | Yes | ### `apiKey` [#api-key] **Type** `string` · **Optional** Production API key for the translation service. Falls back to the `GT_API_KEY` environment variable. ### `devApiKey` [#dev-api-key] **Type** `string` · **Optional** Development API key. Falls back to the `GT_DEV_API_KEY` environment variable. ### `sourceLocale` [#source-locale] **Type** `string` · **Optional** Default source locale for translations. ### `targetLocale` [#target-locale] **Type** `string` · **Optional** Default target locale for translations. ### `locales` [#locales] **Type** `string[]` · **Optional** Array of supported locale codes. ### `projectId` [#project-id] **Type** `string` · **Optional** Project identifier. Falls back to the `GT_PROJECT_ID` environment variable. ### `baseUrl` [#base-url] **Type** `string` · **Optional** Custom API endpoint, used for Enterprise deployments. ### `customMapping` [#custom-mapping] **Type** [`CustomMapping`](/docs/platform/core/reference/types/custom-mapping) · **Optional** Custom locale code mappings and locale property overrides. See [`CustomMapping`](/docs/platform/core/reference/types/custom-mapping). ## Example [#example] ```typescript // Basic setup const gt = new GT({ apiKey: 'your-api-key', sourceLocale: 'en', targetLocale: 'es', locales: ['en', 'es', 'fr'] }); ``` ```typescript // With environment variables const gt = new GT({ sourceLocale: 'en', targetLocale: 'es' }); // Uses GT_API_KEY and GT_PROJECT_ID from the environment ```