Skip to content

Commit

Permalink
KCL-11649 Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Bulyukhin committed Jan 19, 2024
1 parent 52eba49 commit 073828f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,26 @@ useEffect(() => {
For even better experience, you can combine the previous two methods and re-fetch content from Delivery Preview API
on the client-side to update affected placed while waiting for the rebuild process to finish.

### Real-time feedback in Web Spotlight

Starting from version 3.2.0-next.0, Smart Link SDK support real-time feedback in Web Spotlight. If your preview website
uses the supported SDK version, Kontent.ai will send the updated elements to your website via the iframe communication
right after you update them in the in-context editor.

**Please note, that your preview website won't update automatically, and it is up to you to decide how to handle this new event in your application.**

#### Setting up real-time feedback in your app

```ts
import KontentSmartLink, { KontentSmartLinkEvent } from '@kontent-ai/smart-link';

const sdk = KontentSmartLink.initialize({ ... });

sdk.on(KontentSmartLink.Update, (data) => {
// update the state of your app with the new data here
});
```

### Using SDK inside and outside Web Spotlight

When Kontent.ai Smart Link SDK is used outside Web Spotlight, it listens to the query parameters in the URL to toggle smart
Expand Down

0 comments on commit 073828f

Please sign in to comment.