@timbenniks/contentstack-platform-sdk 0.1.0 → 0.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 +63 -0
- package/package.json +16 -6
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @timbenniks/contentstack-platform-sdk
|
|
2
|
+
|
|
3
|
+
Unified TypeScript SDK for building external apps on Contentstack.
|
|
4
|
+
|
|
5
|
+
This package includes:
|
|
6
|
+
|
|
7
|
+
- Core API clients (`/cma`, `/launch`, `/brandkit`, `/knowledge-vault`, `/generative-ai`)
|
|
8
|
+
- Server utilities (`/server`, `/server/middleware`, `/server/proxy`, `/server/webhooks`)
|
|
9
|
+
- React integration (`/react`, `/react/provider`, `/react/hooks`, `/react/auth`, `/react/content`)
|
|
10
|
+
- Vue integration (`/vue`, `/vue/provider`, `/vue/composables`, `/vue/auth`, `/vue/content`)
|
|
11
|
+
- Utilities (`/regions`, `/images`, `/rte`)
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @timbenniks/contentstack-platform-sdk
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start (CMA)
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { createCMAClient } from "@timbenniks/contentstack-platform-sdk/cma"
|
|
23
|
+
|
|
24
|
+
const cma = createCMAClient({
|
|
25
|
+
region: "us",
|
|
26
|
+
apiKey: "blt...",
|
|
27
|
+
auth: { type: "management-token", token: "cms..." },
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const entries = await cma.entries.listAll("blog_post")
|
|
31
|
+
console.log(`Found ${entries.length} entries`)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Regions
|
|
35
|
+
|
|
36
|
+
Supported regions:
|
|
37
|
+
|
|
38
|
+
- `us` (alias: `na`)
|
|
39
|
+
- `eu` (alias: `europe`)
|
|
40
|
+
- `au` (alias: `australia`)
|
|
41
|
+
- `azure-na`
|
|
42
|
+
- `azure-eu`
|
|
43
|
+
- `gcp-na`
|
|
44
|
+
- `gcp-eu`
|
|
45
|
+
|
|
46
|
+
## Subpath Imports
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import { createCMAClient } from "@timbenniks/contentstack-platform-sdk/cma"
|
|
50
|
+
import { createBrandKitClient } from "@timbenniks/contentstack-platform-sdk/brandkit"
|
|
51
|
+
import { createGenerativeAIClient } from "@timbenniks/contentstack-platform-sdk/generative-ai"
|
|
52
|
+
import { imageTransform } from "@timbenniks/contentstack-platform-sdk/images"
|
|
53
|
+
import { toHTML } from "@timbenniks/contentstack-platform-sdk/rte"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Documentation
|
|
57
|
+
|
|
58
|
+
- Full docs: https://github.com/timbenniks/contentstack-platform-sdk/tree/main/packages/docs
|
|
59
|
+
- Repository: https://github.com/timbenniks/contentstack-platform-sdk
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
Private - Contentstack
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timbenniks/contentstack-platform-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Unified TypeScript SDK for building apps on Contentstack",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=18"
|
|
9
9
|
},
|
|
10
|
-
"files": [
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
11
13
|
"exports": {
|
|
12
14
|
".": {
|
|
13
15
|
"types": "./dist/index.d.ts",
|
|
@@ -170,10 +172,18 @@
|
|
|
170
172
|
"next-auth": ">=5.0.0-beta.0"
|
|
171
173
|
},
|
|
172
174
|
"peerDependenciesMeta": {
|
|
173
|
-
"react": {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
"
|
|
175
|
+
"react": {
|
|
176
|
+
"optional": true
|
|
177
|
+
},
|
|
178
|
+
"react-dom": {
|
|
179
|
+
"optional": true
|
|
180
|
+
},
|
|
181
|
+
"vue": {
|
|
182
|
+
"optional": true
|
|
183
|
+
},
|
|
184
|
+
"next-auth": {
|
|
185
|
+
"optional": true
|
|
186
|
+
}
|
|
177
187
|
},
|
|
178
188
|
"devDependencies": {
|
|
179
189
|
"@testing-library/jest-dom": "^6.6.0",
|