# gt-node: General Translation Node.js SDK: Configuring gt-node URL: https://generaltranslation.com/en-GB/docs/node/guides/configuring.mdx --- title: Configuring gt-node description: How to initialise General Translation gt-node with locales, credentials, and translation delivery. related: links: - /docs/node/guides/translating-strings - /docs/node/guides/detecting-locale - /docs/node/guides/storing-translations --- `gt-node` is configured entirely through the [`initializeGT`](/docs/node/reference/functions/initialize-gt) call you make once at startup. This guide covers what to pass and how translations are delivered. *Note: `gt-node` does not read `gt.config.json` automatically. It does read `GT_PROJECT_ID`, `GT_API_KEY`, and `GT_DEV_API_KEY` as credential fallbacks.* ## Initialise at startup [#initialize] Call [`initializeGT`](/docs/node/reference/functions/initialize-gt) once, before handling any requests, with your locales and credentials. ```ts title="server.js" import { initializeGT } from 'gt-node'; initializeGT({ defaultLocale: 'en', locales: ['en', 'es', 'fr'], }); ``` To keep values in sync with the CLI, import your `gt.config.json` and spread its fields into the call. ## Add credentials [#credentials] Set your Project ID and API keys in the environment where the service runs. [`initializeGT`](/docs/node/reference/functions/initialize-gt) uses them when you omit the matching fields: ```bash export GT_PROJECT_ID="your-project-id" export GT_DEV_API_KEY="gtx-dev-..." export GT_API_KEY="gtx-api-..." ``` Values passed directly to [`initializeGT`](/docs/node/reference/functions/initialize-gt) take precedence over environment variables. An empty explicit value falls back to the environment value. In development, a Project ID and development API key enable on-demand translation and hot reload, so new strings get translated as you work. In production, translations come from your pre-generated files or the CDN. See the [Configuration reference](/docs/node/reference/config) for every option. ## Choose how translations are delivered [#delivery] `gt-node` resolves translations in one of these modes: * **General Translation CDN:** provide a `projectId` (without a custom loader) to fetch translations from GT's CDN. * **Local files:** provide a [`loadTranslations`](/docs/react/reference/functions/load-translations) callback that returns translations for a locale. See [Storing translations locally](/docs/node/guides/storing-translations). * **Custom endpoint:** set a custom `cacheUrl` to load from your own host, or `null` to disable remote loading. ## Handle missing translations [#missing] When a translation is missing, `gt-node` returns the source string interpolated with your variables rather than throwing, so a request always renders. Dictionary lookups via [`getTranslations`](/docs/node/reference/functions/get-translations) are the exception: an unknown dictionary id throws. Keep [`initializeGT`](/docs/node/reference/functions/initialize-gt) values aligned with what the CLI generates so production has translations ready. ## Next steps - /docs/node/guides/translating-strings - /docs/node/guides/detecting-locale - /docs/node/guides/storing-translations