{"id":22831527,"url":"https://github.com/phrase/i18next-phrase-backend","last_synced_at":"2026-02-27T12:46:21.255Z","repository":{"id":166383554,"uuid":"626360859","full_name":"phrase/i18next-phrase-backend","owner":"phrase","description":"i18next backend for using OTA translations from Phrase Strings","archived":false,"fork":false,"pushed_at":"2026-01-23T13:28:05.000Z","size":368,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":10,"default_branch":"main","last_synced_at":"2026-01-24T05:35:38.918Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phrase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-11T10:07:30.000Z","updated_at":"2026-01-23T13:28:07.000Z","dependencies_parsed_at":"2024-06-11T07:50:34.483Z","dependency_job_id":"c4cb9d81-fe9c-4738-ab2a-5e8b75cd9838","html_url":"https://github.com/phrase/i18next-phrase-backend","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/phrase/i18next-phrase-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrase%2Fi18next-phrase-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrase%2Fi18next-phrase-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrase%2Fi18next-phrase-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrase%2Fi18next-phrase-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phrase","download_url":"https://codeload.github.com/phrase/i18next-phrase-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrase%2Fi18next-phrase-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29895641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T12:09:13.686Z","status":"ssl_error","status_checked_at":"2026-02-27T12:09:13.282Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-12T20:26:27.287Z","updated_at":"2026-02-27T12:46:21.248Z","avatar_url":"https://github.com/phrase.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# i18nextPhraseBackend - Phrase Strings backend for i18next\n\n## Description\n\nThis small library implements an example [backend](https://www.i18next.com/overview/plugins-and-utils#backends) for [`i18next`](https://www.i18next.com/) which retrieves the translations from Phrase OTA releases. The distribution should be created for `i18next` platform.\n\n## Usage\n\nA demo project can be found at https://github.com/phrase/ota-web-demo\n\n### Basic usage\n\n```\nnpm install --save @phrase/i18next-backend\n```\n\n```javascript\nimport i18n from \"i18next\";\nimport { I18nextPhraseBackend } from \"@phrase/i18next-backend\";\n\ni18n\n  .use(I18nextPhraseBackend)\n  .init({\n    fallbackLng: 'en',\n    backend: {\n      distribution: 'DISTRIBUTION_ID',\n      secret: 'YOUR_ENVIRONMENT_SECRET',\n      appVersion: '1.0.0',\n    }\n  });\n```\n\n### Options\n\nThe backend accepts several options:\n\n* `distribution` (required): The ID of your Phrase Strings OTA distribution\n* `secret` (required): The secret token of your Phrase Strings OTA distribution. There are different secrets for `development` (i.e. beta) and `production` environments\n* `appVersion`: You can prevent some OTA releases from being serverd to certain app versions by providing minimum and maximum app version in Phrase Strings\n* `cacheExpirationTime`: See [Caching](#caching) below\n* `host`: By default, this library uses EU instance of Phrase Strings, if you use US DC, set this to `https://ota.us.phrase.com`\n* `format`: By default this library uses the i18next format, if you use i18next v4 (for the new pluralization resolution strategy), set this to `i18next_4`\n\n## Caching\n\nThe library is caching translations and won't check for new translations for 5 minutes. This can be configured by setting the `cacheExpirationTime` option in the backend configuration for testing purposes. It's recommended to use at least 5 minutes in production.\n\n```javascript\ni18n\n  .use(I18nextPhraseBackend)\n  .init({\n    fallbackLng: 'en',\n    backend: {\n      distribution: 'DISTRIBUTION_ID',\n      secret: 'YOUR_ENVIRONMENT_SECRET',\n      appVersion: '1.0.0',\n      cacheExpirationTime: 60 * 5, // time in seconds\n    }\n  });\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphrase%2Fi18next-phrase-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphrase%2Fi18next-phrase-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphrase%2Fi18next-phrase-backend/lists"}