@shopware/api-client 1.0.2 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,6 +10,8 @@ You can use types generated from your custom API instance to have autocompletion
10
10
 
11
11
  To generate your own types use [@shopware/api-gen](https://www.npmjs.com/package/@shopware/api-gen) CLI.
12
12
 
13
+ To take a deep dive into the topic visit the [🧑‍🎓 API Client Tutorial](https://api-client-tutorial-composable-frontends.pages.dev) first.
14
+
13
15
  ## Setup
14
16
 
15
17
  Install npm package:
@@ -251,11 +253,25 @@ try {
251
253
  }
252
254
  ```
253
255
 
256
+ ### Hooks
257
+
258
+ Api client provides hooks to listen to events like context change, authentication change or default headers change. Example:
259
+
260
+ ```typescript
261
+ apiClient.hook("onDefaultHeaderChanged", (key, value) => {
262
+ // here we can detect that the default header has changed, either by the user or by the headers incoming from the API
263
+ });
264
+ ```
265
+
266
+ calling `apiClient.hook` will autocomplete the list of available hooks.
267
+
254
268
  ## Links
255
269
 
270
+ - [🧑‍🎓 Tutorial](https://api-client-tutorial-composable-frontends.pages.dev)
271
+
256
272
  - [📘 Documentation](https://frontends.shopware.com)
257
273
 
258
- - [👥 Community Slack](https://shopwarecommunity.slack.com) (`#shopware-frontends` channel)
274
+ - [👥 Community Slack](https://shopwarecommunity.slack.com) (`#composable-frontends` channel)
259
275
 
260
276
  <!-- AUTO GENERATED CHANGELOG -->
261
277
 
@@ -263,10 +279,8 @@ try {
263
279
 
264
280
  Full changelog for stable version is available [here](https://github.com/shopware/frontends/blob/main/packages/api-client/CHANGELOG.md)
265
281
 
266
- ### Latest changes: 1.0.2
282
+ ### Latest changes: 1.1.1
267
283
 
268
284
  ### Patch Changes
269
285
 
270
- - [#1089](https://github.com/shopware/frontends/pull/1089) [`db7c93f`](https://github.com/shopware/frontends/commit/db7c93ff8cbb581221c11a492e77068af8faa8d6) Thanks [@mkucmus](https://github.com/mkucmus)! - Migrate eslint config to flat format
271
-
272
- - [#1074](https://github.com/shopware/frontends/pull/1074) [`b688163`](https://github.com/shopware/frontends/commit/b68816391ee8ed1ac94a6462a2a016d708f259b4) Thanks [@mkucmus](https://github.com/mkucmus)! - Update default schemas' `translated` properties as required
286
+ - [#1425](https://github.com/shopware/frontends/pull/1425) [`8df7651`](https://github.com/shopware/frontends/commit/8df76511c8afca78c79fe3f009ed32d207913f86) Thanks [@quando1910](https://github.com/quando1910)! - - fix: override header value when invoke adminApiClient and storeAPiClient