From 0d5240957327bcdfbc3b9fce1b98cc26e974aed7 Mon Sep 17 00:00:00 2001 From: Yevheniy Oliynyk Date: Tue, 10 Sep 2024 17:15:59 +0200 Subject: [PATCH] fix --- src/model.ts | 2 +- website/docs/configuration.mdx | 35 +--------------------------------- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/src/model.ts b/src/model.ts index 64dd1b9..df74692 100644 --- a/src/model.ts +++ b/src/model.ts @@ -1,6 +1,6 @@ export interface ClientConfig { /** - * Specify your own http client. Default uses axios + * Specify your own http client. Default uses fetch */ httpClient?: HttpClient; /** diff --git a/website/docs/configuration.mdx b/website/docs/configuration.mdx index f7fb100..41a30d2 100644 --- a/website/docs/configuration.mdx +++ b/website/docs/configuration.mdx @@ -28,7 +28,7 @@ Distribution Hash. See the [Content Delivery](https://support.crowdin.com/conten Custom HTTP client. -Default: [Axios](https://www.npmjs.com/package/axios) HTTP client +Default: [Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) HTTP client ### `languageCode` @@ -68,39 +68,6 @@ Disable deep merge of json-based files for string-based methods and use shallow Default: `false` -## Axios error - -There might be an issue with axios dependency when using webpack 5 or babel build tools (e.g. [React Scripts 5+](https://create-react-app.dev) or [Expo](https://react.dev/learn/start-a-new-react-project#expo)). - -In case if you got following error: - -``` -ERROR -Cannot read properties of undefined (reading 'create') -TypeError: Cannot read properties of undefined (reading 'create') -``` - -You will have to manually install [axios 1.6.0](https://github.com/axios/axios) - -```bash -npm i axios -``` - -And pass it in OTA Client config - -```typescript -import otaClient from '@crowdin/ota-client'; - -const client = new otaClient(hash, { - httpClient: { - get: async (url) => { - const res = await axios.get(url); - return res.data; - } - } -}); -``` - ## Further reading - [API](/api/classes/OtaClient)