@contentful/react-apps-toolkit 0.5.0 → 0.5.3

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.
Files changed (2) hide show
  1. package/README.md +20 -1
  2. package/package.json +3 -4
package/README.md CHANGED
@@ -18,7 +18,26 @@ yarn add @contentful/react-apps-toolkit
18
18
 
19
19
  ## Available features
20
20
 
21
- The following hooks and utilities are exported from the package: Nothing
21
+ The following hooks and utilities are exported from the package:
22
+
23
+ ### `useSDK`
24
+
25
+ This hook returns the App SDK.
26
+
27
+ The only requirement for using it is that the component that uses it is wrapped within the `SDKProvider`.
28
+ If it is not, the hook will throw an error.
29
+
30
+ Here is an example of how you can use it:
31
+
32
+ ```tsx
33
+ function App() {
34
+ const sdk = useSDK<FieldExtensionSDK>();
35
+
36
+ return <>App Id: {sdk.ids.app}</>
37
+ }
38
+
39
+ ```
40
+
22
41
 
23
42
  #### SDKProvider
24
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/react-apps-toolkit",
3
- "version": "0.5.0",
3
+ "version": "0.5.3",
4
4
  "description": "Toolkit for building a Contentful app in React",
5
5
  "keywords": [],
6
6
  "author": "Contentful GmbH",
@@ -27,8 +27,7 @@
27
27
  "scripts": {
28
28
  "build": "rimraf dist && tsc",
29
29
  "test": "jest",
30
- "pre-commit": "lint-staged",
31
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
30
+ "pre-commit": "lint-staged"
32
31
  },
33
32
  "peerDependencies": {
34
33
  "react": ">=16.8.0"
@@ -50,5 +49,5 @@
50
49
  "@contentful/app-sdk": "^4.0.0",
51
50
  "contentful-management": ">=7.30.0"
52
51
  },
53
- "gitHead": "e1614587cdefa69c7f852e7f5448c3b9b6446314"
52
+ "gitHead": "6f03dd3aae0d79672bf07dce89fa7e8f1f74085c"
54
53
  }