You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+93-79Lines changed: 93 additions & 79 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,6 @@ To get started with JavaScript, you will need the following:
10
10
- Node.js 10 or later
11
11
12
12
## SDK Installation and Setup
13
-
> Note: If you are using JavaScript Contentstack SDK, you don’t need to run the command as ‘@contentstack/utils’ is already imported in the SDK.
14
13
15
14
Use the following command to install Contentstack JavaScript Utils SDK:
16
15
```sh
@@ -87,104 +86,119 @@ Contentstack Utils SDK lets you interact with the Content Delivery APIs and retr
87
86
### Fetch Embedded Item(s) from a Single Entry
88
87
#### Render HTML RTE Embedded object
89
88
To get an embedded item of a single entry, you need to provide the stack API key, environment name, delivery token, content type and entry UID. Then, use the `includeEmbeddedItems` and `Contentstack.Utils.render` functions as shown below:
If you have multiple RTE fields in an entry and want to fetch the embedded items from a particular RTE field, you need to provide a path of those RTE fields.
107
111
108
112
Refer to the example code below:
109
-
```js
113
+
```ts
110
114
//code to render embedded item from an RTE field and from another RTE field nested within a group field
To get a single entry, you need to provide the stack API key, environment name, delivery token, content type and entry UID. Then, use `Contentstack.Utils.jsonToHTML` function as shown below:
> Node: Supercharged RTE also supports Embedded items to get all embedded items while fetching entry use `includeEmbeddedItems` function.
136
147
137
148
### Fetch Embedded Item(s) from Multiple Entries
138
149
#### Render HTML RTE Embedded object
139
150
140
151
To get embedded items from multiple entries, you need to provide the content type UID. You can also use the path variable in case the entries have multiple RTE fields.
To get a multiple entries, you need to provide the stack API key, environment name, delivery token, content type and entry UID. Then, use `Contentstack.Utils.jsonToHTML` function as shown below:
0 commit comments