# generaltranslation: General Translation Core SDK: GTConstructorParams URL: https://generaltranslation.com/ja/docs/core/types/gt-constructor-params.mdx --- title: GTConstructorParams description: GT クラスのコンストラクターパラメータ用 TypeScript インターフェース --- ## 概要 `GTConstructorParams` は、GT クラスを初期化する際の設定オプションを定義します。 ```typescript interface GTConstructorParams { apiKey?: string; devApiKey?: string; sourceLocale?: string; targetLocale?: string; locales?: string[]; projectId?: string; baseUrl?: string; customMapping?: CustomMapping; } ``` すべてのプロパティは省略可能です。指定しない場合、コンストラクタは環境変数から `GT_API_KEY`、`GT_DEV_API_KEY`、`GT_PROJECT_ID` を読み取ります。 ## プロパティ | プロパティ | 型 | 说明 | | ---------------- | --------------- | ---------------- | | `apiKey?` | `string` | 本番用 API キー | | `devApiKey?` | `string` | 開発用 API キー | | `sourceLocale?` | `string` | デフォルトのソースロケール | | `targetLocale?` | `string` | デフォルトのターゲットロケール | | `locales?` | `string[]` | サポートされているロケールコード | | `projectId?` | `string` | プロジェクト識別子 | | `baseUrl?` | `string` | カスタム API エンドポイント | | `customMapping?` | `CustomMapping` | カスタムロケールマッピング | ## 例 ### 基本セットアップ ```typescript copy const gt = new GT({ apiKey: 'your-api-key', sourceLocale: 'en', targetLocale: 'es', locales: ['en', 'es', 'fr'] }); ``` ### 環境変数を使う場合 ```typescript copy const gt = new GT({ sourceLocale: 'en', targetLocale: 'es' }); // 環境変数から GT_API_KEY と GT_PROJECT_ID を使用 ``` ## 関連型 * [`CustomMapping`](/docs/core/types/custom-mapping) - カスタムロケールの定義