{"id":48169,"library":"i18next-async-storage-backend","title":"i18next AsyncStorage Backend","description":"A caching layer backend for i18next that loads and caches translation resources from React Native's AsyncStorage. Version 1.0.2, last updated in 2019. Typically used in combination with the i18next Chained Backend to provide a primary cache with a fallback loader. Requires @react-native-community/async-storage as a peer dependency, which is deprecated in favor of @react-native-async-storage/async-storage. Minimal API surface; configuration via prefix, expiration time, and version objects.","status":"maintenance","version":"1.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/timbrandin/i18next-async-storage-backend","tags":["javascript","i18next","i18next-backend"],"install":[{"cmd":"npm install i18next-async-storage-backend","lang":"bash","label":"npm"},{"cmd":"yarn add i18next-async-storage-backend","lang":"bash","label":"yarn"},{"cmd":"pnpm add i18next-async-storage-backend","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for AsyncStorage access; deprecated in favor of @react-native-async-storage/async-storage","package":"@react-native-community/async-storage","optional":false},{"reason":"Core i18next library required for instantiation","package":"i18next","optional":false},{"reason":"Commonly used together to implement fallback chain; this backend is typically the primary cache","package":"i18next-chained-backend","optional":true}],"imports":[{"note":"Default export, not named","wrong":"import { AsyncStorageBackend } from 'i18next-async-storage-backend'","symbol":"AsyncStorageBackend","correct":"import AsyncStorageBackend from 'i18next-async-storage-backend'"},{"note":"Common pattern to use with Chained Backend; not part of this package","wrong":"import { Backend } from 'i18next-chained-backend'","symbol":"Backend (Chained)","correct":"import Backend from 'i18next-chained-backend'"},{"note":"Common fallback; in CJS use .default or use require('i18next-xhr-backend').default","wrong":"const XHR = require('i18next-xhr-backend').default","symbol":"XHR Backend","correct":"import XHR from 'i18next-xhr-backend'"}],"quickstart":{"code":"import i18next from 'i18next';\nimport Backend from 'i18next-chained-backend';\nimport AsyncStorageBackend from 'i18next-async-storage-backend';\nimport XHR from 'i18next-xhr-backend';\n\ni18next\n  .use(Backend)\n  .init({\n    lng: 'en',\n    fallbackLng: 'en',\n    backend: {\n      backends: [\n        AsyncStorageBackend,\n        XHR\n      ],\n      backendOptions: [\n        {\n          prefix: 'i18next_res_',\n          expirationTime: 7*24*60*60*1000,\n          versions: { en: 'v1', fr: 'v1' }\n        },\n        {\n          loadPath: '/locales/{{lng}}/{{ns}}.json'\n        }\n      ]\n    }\n  });\n\ni18next.on('initialized', () => {\n  console.log('i18next ready:', i18next.t('key'));\n});","lang":"javascript","description":"Shows basic setup with i18next Chained Backend using AsyncStorage as primary cache and XHR as fallback"},"warnings":[{"fix":"Replace with @react-native-async-storage/async-storage and possibly patch the package to avoid peer warnings","message":"Package uses deprecated @react-native-community/async-storage peer dependency","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use `import AsyncStorageBackend from 'i18next-async-storage-backend'`","message":"Default export must be used; named import will fail","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use with i18next v22 or consider an alternative like i18next-localstorage-backend","message":"Package is not compatible with newer i18next v23+ due to internal API changes","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add a .d.ts file or use @types/i18next-async-storage-backend if available","message":"No TypeScript types provided; manual type definition may be needed","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'/async-storage':50,66 '1.0.2':22 '2019':26 'api':68 'async':64 'asyncstorag':2,20 'backend':3,7,35,82 'cach':5,13,40 'chain':34 'combin':30 'communiti':49 'configur':70 'depend':54 'deprec':57 'expir':73 'fallback':43 'favor':59 'i18next':1,9,33,79,81 'i18next-backend':80 'javascript':78 'last':23 'layer':6 'load':11 'loader':44 'minim':67 'nativ':18,48,63 'object':77 'peer':53 'prefix':72 'primari':39 'provid':37 'react':17,47,62 'react-native-async-storag':61 'react-native-commun':46 'requir':45 'resourc':15 'storag':65 'surfac':69 'time':74 'translat':14 'typic':27 'updat':24 'use':28 'version':21,76 'via':71","created_at":"2026-06-07T16:55:15.223056+00:00","updated_at":"2026-06-07T16:55:15.223056+00:00","problems":[{"fix":"npm install @react-native-async-storage/async-storage","cause":"Missing peer dependency or wrong package name (should be @react-native-async-storage/async-storage)","error":"Module not found: Can't resolve '@react-native-community/async-storage'"},{"fix":"Change import to: import AsyncStorageBackend from 'i18next-async-storage-backend'","cause":"Using named import instead of default import","error":"TypeError: AsyncStorageBackend is not a constructor"},{"fix":"Ensure i18next.use(Backend) is called before init and backends array includes AsyncStorageBackend and fallback","cause":"i18next not using Chained Backend or backend not registered correctly","error":"Error: backend namespace not loaded"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/timbrandin/i18next-async-storage-backend","github":"https://github.com/timbrandin/i18next-async-storage-backend","docs":null,"changelog":null,"pypi":null,"npm":"i18next-async-storage-backend","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}