Sorry, no results found for "".

In this page

SvelteKit > Real-time updates

Real-time updates

Live updates can be extremely useful both for content editors and the regular visitors of your app/website:

  • Content-editors in Preview Mode can see drafts directly in the production website, without having to refresh the page;

  • Visitors can immediately see new content as it gets published, allowing all kinds of real-time interactions with your website/app (ie. live-news coverage).

Thanks to the querySubscription store provided by the @datocms/svelte package you can get real-time updates for the page when the content changes. This function connects to the DatoCMS's Real-time Updates API to receive the updated query results in real-time, and is able to reconnect in case of network failures.

Live updates are great both to get instant previews of your content while editing it inside DatoCMS, or to offer real-time updates of content to your visitors (ie. news site).

Reference

Please consult the @datocms/svelte documentation to learn more about how to configure querySubscription, or take a look at the code of our Tech Starter Kit: