<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Manuel Schröder</title>
    <description>The latest articles on DEV Community by Manuel Schröder (@manuelschroederdev).</description>
    <link>https://dev.to/manuelschroederdev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F866517%2F566ac6bd-4d14-4f5f-b314-a170d54056b3.jpg</url>
      <title>DEV Community: Manuel Schröder</title>
      <link>https://dev.to/manuelschroederdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manuelschroederdev"/>
    <language>en</language>
    <item>
      <title>Announcing a Storyblok Loader for the Astro Content Layer API</title>
      <dc:creator>Manuel Schröder</dc:creator>
      <pubDate>Thu, 19 Sep 2024 13:26:56 +0000</pubDate>
      <link>https://dev.to/storyblok/announcing-a-storyblok-loader-for-the-astro-content-layer-api-41of</link>
      <guid>https://dev.to/storyblok/announcing-a-storyblok-loader-for-the-astro-content-layer-api-41of</guid>
      <description>&lt;p&gt;We are very excited to announce that the latest alpha version of our Astro integration &lt;a href="https://github.com/storyblok/storyblok-astro" rel="noopener noreferrer"&gt;@storyblok/astro&lt;/a&gt; now supports the new &lt;a href="https://astro.build//blog/content-layer-deep-dive/" rel="noopener noreferrer"&gt;Astro Content Layer API&lt;/a&gt;. The Content Layer API is an innovative new solution to fetch and handle content from external APIs and store it locally. It is designed to scale efficiently and handle large sites with thousands of pages highly performantly. With our new, built-in Storyblok loader, fetching your stories and turning them into an &lt;a href="https://docs.astro.build/en/guides/content-collections/" rel="noopener noreferrer"&gt;Astro Content Collection&lt;/a&gt; is simple and straightforward to accomplish.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use it
&lt;/h2&gt;

&lt;p&gt;First of all, install the latest alpha version of our integration in your Astro project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i @storyblok/astro@alpha
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As this is an experimental opt-in feature, you need to enable it by setting &lt;code&gt;contentLayer&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; in your &lt;code&gt;astro.config.mjs&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineConfig&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;integrations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nf"&gt;storyblok&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;accessToken&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;your-access-token&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;contentLayer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;experimental&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;contentLayer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, in the &lt;code&gt;src/content&lt;/code&gt; folder, you need to create a &lt;code&gt;config.ts&lt;/code&gt; file that defines one or more collections that consist of the entirety of stories available in your Storyblok space.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;storyblokLoader&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@storyblok/astro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;defineCollection&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;astro:content&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;storyblokCollection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;defineCollection&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;loader&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;storyblokLoader&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;accessToken&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;your-access-token&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;apiOptions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;region&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;us&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;published&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}),&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;collections&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;storyblok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;storyblokCollection&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s look at an example &lt;code&gt;[…slug].astro&lt;/code&gt; dynamic route that renders the content entries stored in a collection.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;---&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;StoryblokComponent&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@storyblok/astro/StoryblokComponent.astro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;BaseLayout&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../layouts/BaseLayout.astro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getCollection&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;astro:content&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;ISbStoryData&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@storyblok/astro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getStaticPaths&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;stories&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;getCollection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;storyblok&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;stories&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ISbStoryData&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;full_slug&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;story&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Props&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;story&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ISbStoryData&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;story&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Astro&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;---&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;BaseLayout&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;StoryblokComponent&lt;/span&gt; &lt;span class="nx"&gt;blok&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;story&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/BaseLayout&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Benefits of using Storyblok with the Astro Content Layer API
&lt;/h2&gt;

&lt;p&gt;The Astro Content Layer API stores all stories of a Storyblok space locally in the project. This approach provides two benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only new and updated stories have to be fetched from Storyblok instead of fetching all stories with every build. Especially with large-scale sites with thousands of pages, this can significantly reduce API traffic and reduce build times.&lt;/li&gt;
&lt;li&gt;Direct access to the database provides a powerful query API to perform complex search and filtering operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Astro Content Layer API is designed to work with &lt;a href="https://docs.astro.build/en/basics/rendering-modes/" rel="noopener noreferrer"&gt;Static Site Generation (SSG)&lt;/a&gt;. Therefore, it is a perfect approach to consider for the production environment of a Storyblok project. You can learn more about deploying Storyblok projects &lt;a href="https://www.storyblok.com/tp/create-preview-production-environments-and-deploy" rel="noopener noreferrer"&gt;in this tutorial&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next steps
&lt;/h2&gt;

&lt;p&gt;We hope you’re excited to try out this new feature! We would absolutely love to see your projects built with Storyblok and Astro, and hear your feedback about our experimental support of the new Content Layer API.&lt;/p&gt;

&lt;p&gt;Would you like to contribute to the development of @storyblok/astro? Feel free to create an issue or a PR in the &lt;a href="https://github.com/storyblok/storyblok-astro" rel="noopener noreferrer"&gt;official GitHub repository&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>storyblok</category>
      <category>astro</category>
      <category>headless</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Announcing Live Preview for Storyblok’s Astro Integration</title>
      <dc:creator>Manuel Schröder</dc:creator>
      <pubDate>Thu, 13 Jun 2024 15:31:35 +0000</pubDate>
      <link>https://dev.to/storyblok/announcing-live-preview-for-storybloks-astro-integration-502a</link>
      <guid>https://dev.to/storyblok/announcing-live-preview-for-storybloks-astro-integration-502a</guid>
      <description>&lt;p&gt;We are absolutely thrilled to announce that starting with version &lt;code&gt;4.1.0&lt;/code&gt; our Astro integration &lt;a href="https://github.com/storyblok/storyblok-astro" rel="noopener noreferrer"&gt;@storyblok/astro&lt;/a&gt; now officially supports the live preview functionality of Storyblok’s beloved Visual Editor. With this new feature, developers can empower editors to create content in Astro projects and benefit from real-time, instantaneous feedback reflecting their changes. Let’s see it in action:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fux94tub4pa0t87nrv4op.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fux94tub4pa0t87nrv4op.gif" alt="Image description" width="1024" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Use it
&lt;/h2&gt;

&lt;p&gt;As this is an experimental, opt-in feature, you first of all need to enable it by setting &lt;code&gt;livePreview&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; in your &lt;code&gt;astro.config.mjs&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineConfig&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;integrations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nf"&gt;storyblok&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;accessToken&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;your-access-token&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;livePreview&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since the live preview feature depends on the Astro object, we’ve designed a new utility function called &lt;code&gt;useStoryblok&lt;/code&gt; that takes it as a parameter. Additionally, you may want to pass &lt;a href="https://www.storyblok.com/docs/Guides/storyblok-latest-js" rel="noopener noreferrer"&gt;Storyblok Bridge Options&lt;/a&gt; for a particular page or route as a parameter. Let’s take a look at an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="o"&gt;---&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useStoryblok&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@storyblok/astro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;StoryblokComponent&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@storyblok/astro/StoryblokComponent.astro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Astro&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;story&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;useStoryblok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="c1"&gt;// The slug to fetch&lt;/span&gt;
  &lt;span class="s2"&gt;`cdn/stories/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;home&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="c1"&gt;// The API options&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;draft&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="c1"&gt;// The Bridge options (optional, if an empty object, null, or false are set, the API options will be considered automatically as far as applicable)&lt;/span&gt;
  &lt;span class="p"&gt;{},&lt;/span&gt;
  &lt;span class="c1"&gt;// The Astro object (essential for the live preview functionality)&lt;/span&gt;
  &lt;span class="nx"&gt;Astro&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;---&lt;/span&gt;

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;StoryblokComponent&lt;/span&gt; &lt;span class="na"&gt;blok&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;story&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, make sure that your project runs in SSR mode for the live preview functionality to work. For further information, you may want to read our &lt;a href="https://www.storyblok.com/tp/create-a-preview-environment-for-your-astro-website" rel="noopener noreferrer"&gt;tutorial on how to create a dedicated preview environment for a Storyblok and Astro project&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And that’s it, just like that, you enabled live preview!&lt;/p&gt;

&lt;h2&gt;
  
  
  How it Originated
&lt;/h2&gt;

&lt;p&gt;When we released the first version of &lt;code&gt;@storyblok/astro&lt;/code&gt; in 2022, we were aware that, in direct comparison to the other integrations provided as part of our JavaScript SDK ecosystem, the Astro integration does not offer the benefit of real-time visual feedback. As Astro differs fundamentally from other modern JavaScript frameworks and does not provide a client-side runtime for its native components (which, of course, is part of its allure), the time-proven approach we utilize for other frameworks is not applicable in an Astro context. While we had always envisioned and hoped to be able to introduce support for this integral Storyblok feature, we had concluded that it was not technically feasible.&lt;/p&gt;

&lt;p&gt;It took the ingenious effort of one of our closest partners, &lt;a href="https://www.virtual-identity.com/solutions/storyblok/" rel="noopener noreferrer"&gt;Virtual Identity&lt;/a&gt;, and, in particular, their developer &lt;a href="https://github.com/mariohamann" rel="noopener noreferrer"&gt;Mario Hamann&lt;/a&gt;, to prove us (very!) wrong. Virtual Identity Board Member &lt;a href="https://www.linkedin.com/in/timomayer/" rel="noopener noreferrer"&gt;Timo Mayer&lt;/a&gt; and Mario Hamann reached out to us and presented a POC that follows a very creative and masterfully designed approach. In close collaboration, Mario Hamann and our own Dipankar Maikap refined, tested, and integrated this solution. We are truly grateful to Virtual Identity for not only providing this innovative impetus but even going above and beyond to dedicate their time and effort in order to get this market-ready. In any case, we know which &lt;a href="https://www.virtual-identity.com/solutions/storyblok/" rel="noopener noreferrer"&gt;super talented team&lt;/a&gt; we would turn to again to solve an almost impossible challenge.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it Works Under The Hood
&lt;/h2&gt;

&lt;p&gt;In a nutshell, this approach works by updating the DOM using the JavaScript &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceWith" rel="noopener noreferrer"&gt;replaceWith() method&lt;/a&gt;. The DOM is replaced either entirely or partially, depending on the context in which the &lt;code&gt;input&lt;/code&gt; event of the Storyblok Bridge is triggered. Thanks to the power and flexibility of &lt;a href="https://docs.astro.build/en/reference/integrations-reference/" rel="noopener noreferrer"&gt;Astro’s Integration API&lt;/a&gt;, the Astro object can be utilized to store the most up-to-date story data delivered by the Storyblok Bridge. Furthermore, an injected middleware determines whether to load a story normally or update the DOM, taking into account the data stored in the Astro object.&lt;/p&gt;

&lt;p&gt;While this method has proven to work incredibly well in the majority of our tests, it is important to point out that you may encounter performance drawbacks in large-scale projects with complex relations to resolve and/or heavy client slide scripts. Hence, we’ve released it as an experimental, opt-in feature for now. If you experience any issues, we’d really appreciate it if you &lt;a href="https://github.com/storyblok/storyblok-astro/issues/new?assignees=&amp;amp;labels=&amp;amp;projects=&amp;amp;template=issue.bug.md" rel="noopener noreferrer"&gt;created an issue on GitHub&lt;/a&gt;. We rely on your feedback and are more than happy to look into it.&lt;/p&gt;

&lt;p&gt;If you want to explore it yourself, the key logic is contained in these files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/storyblok/storyblok-astro/blob/main/lib/live-preview/handleStoryblokMessage.ts" rel="noopener noreferrer"&gt;./lib/live-preview/handleStoryblokMessage.ts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/storyblok/storyblok-astro/blob/main/lib/live-preview/middleware.ts" rel="noopener noreferrer"&gt;./lib/live-preview/middleware.ts`&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/storyblok/storyblok-astro/blob/main/lib/index.ts" rel="noopener noreferrer"&gt;./lib/index.ts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally, Dipankar Maikap, thanks to the support provided by &lt;a href="https://x.com/matthewcp" rel="noopener noreferrer"&gt;Matthew Phillips&lt;/a&gt;, CTO of The Astro Technology Company, has successfully created a Vite virtual module that makes it possible to pass Storyblok Bridge Options from Astro Pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next Steps
&lt;/h2&gt;

&lt;p&gt;We hope you’re excited to try out this new feature! We would absolutely love to see your projects built with Storyblok and Astro, and hear your feedback about this latest feature.&lt;/p&gt;

&lt;p&gt;Would you like to contribute to the development of &lt;a href="https://github.com/storyblok/storyblok-astro" rel="noopener noreferrer"&gt;@storyblok/astro&lt;/a&gt;? Feel free to create an issue or a PR in the &lt;a href="https://github.com/storyblok/storyblok-astro" rel="noopener noreferrer"&gt;official GitHub repository&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/storyblok/storyblok-astro" rel="noopener noreferrer"&gt;@storyblok/astro GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://npmjs.com/package/@storyblok/astro" rel="noopener noreferrer"&gt;@storyblok/astro NPM package&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.storyblok.com/tp/the-storyblok-astro-ultimate-tutorial" rel="noopener noreferrer"&gt;Astro Ultimate Tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://storyblok.com/docs" rel="noopener noreferrer"&gt;Storyblok Learning Hub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>astro</category>
      <category>storyblok</category>
      <category>webdev</category>
      <category>headless</category>
    </item>
    <item>
      <title>Storyblok’s Astro SDK now supports Astro 3</title>
      <dc:creator>Manuel Schröder</dc:creator>
      <pubDate>Wed, 13 Sep 2023 09:06:41 +0000</pubDate>
      <link>https://dev.to/storyblok/storybloks-astro-sdk-now-supports-astro-3-51ba</link>
      <guid>https://dev.to/storyblok/storybloks-astro-sdk-now-supports-astro-3-51ba</guid>
      <description>&lt;p&gt;We are excited to announce that we released &lt;a href="https://github.com/storyblok/storyblok-astro/releases/tag/v3.0.0" rel="noopener noreferrer"&gt;@storyblok/astro v3.0.0&lt;/a&gt;, providing complete support for &lt;a href="https://astro.build/blog/astro-3/" rel="noopener noreferrer"&gt;Astro 3.0&lt;/a&gt;. You spin off a working Astro 3.0 + Storyblok project in less than a minute by running:&lt;br&gt;
&lt;code&gt;npx @storyblok/create-demo@next -f astro&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzdnurig7s4d3cnlabjod.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzdnurig7s4d3cnlabjod.gif" alt="Setting up a new Astro 3.0 + Storyblok project using @storyblok/create-demo" width="760" height="570"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By the way, our CLI also supports &lt;a href="https://bun.sh/" rel="noopener noreferrer"&gt;Bun&lt;/a&gt; now, so you can also run:&lt;br&gt;
&lt;code&gt;bunx @storyblok/create-demo@next -f astro -p bun&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Astro 3.0 comes packed with amazing new features, such as image optimization, up to 30% faster rendering, SSR enhancements, cleaner and more performant HTML output, and much more. Morever, Astro now is the first major web framework to support the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API" rel="noopener noreferrer"&gt;View Transitions API&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;We are very curious to see what you are building with Storyblok and Astro, and always love to hear your feedback. Feel free to get in touch, for example by joining our &lt;a href="https://discord.com/invite/jKrbAMz" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; or reaching out on &lt;a href="https://twitter.com/storyblok" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you are new to Storyblok and Astro, our &lt;a href="https://www.storyblok.com/tp/the-storyblok-astro-ultimate-tutorial" rel="noopener noreferrer"&gt;Ultimate Tutorial&lt;/a&gt; got you covered. For a good overview and more advanced use cases, you can always refer to the &lt;a href="https://github.com/storyblok/storyblok-astro" rel="noopener noreferrer"&gt;SDK readme&lt;/a&gt;. In case you are already very experienced and want to share your knowledge, you might like to check out our &lt;a href="https://www.storyblok.com/ambassadors" rel="noopener noreferrer"&gt;Storyblok Ambassador&lt;/a&gt; and &lt;a href="https://www.storyblok.com/fs/write-for-our-blog" rel="noopener noreferrer"&gt;Community Writer Program&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>astro</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>headless</category>
    </item>
    <item>
      <title>Announcing @storyblok/astro</title>
      <dc:creator>Manuel Schröder</dc:creator>
      <pubDate>Thu, 01 Sep 2022 13:41:06 +0000</pubDate>
      <link>https://dev.to/storyblok/announcing-storyblokastro-44po</link>
      <guid>https://dev.to/storyblok/announcing-storyblokastro-44po</guid>
      <description>&lt;p&gt;We are very excited to announce the release of &lt;a href="https://github.com/storyblok/storyblok-astro" rel="noopener noreferrer"&gt;@storyblok/astro&lt;/a&gt;! Using Storyblok in your Astro project is now much easier and faster than before. Thanks to the powerful&lt;a href="https://docs.astro.build/en/reference/integrations-reference/" rel="noopener noreferrer"&gt; Astro Integration API&lt;/a&gt; and our new module, you can get up and running in a matter of minutes.&lt;/p&gt;

&lt;p&gt;Let's explore how it works!&lt;/p&gt;

&lt;p&gt;In a hurry? Head over to the &lt;a href="https://stackblitz.com/edit/astro-sdk-demo" rel="noopener noreferrer"&gt;live demo&lt;/a&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;First of all, install &lt;code&gt;@storyblok/astro&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @storyblok/astro
&lt;span class="c"&gt;# yarn add @storyblok/astro&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following code to your &lt;code&gt;astro.config.mjs&lt;/code&gt; and replace the &lt;code&gt;accessToken&lt;/code&gt; with the preview API token of your Storyblok space.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;defineConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;astro/config&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;storyblok&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@storyblok/astro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineConfig&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;integrations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nf"&gt;storyblok&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;accessToken&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;your-access-token&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;page&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;storyblok/Page&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;feature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;storyblok/Feature&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;storyblok/Grid&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;teaser&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;storyblok/Teaser&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, all components that you defined in Storyblok have to be globally registered through the &lt;code&gt;components&lt;/code&gt; object. Henceforth, they’ll be loaded automatically when using &lt;code&gt;StoryblokComponent&lt;/code&gt; as shown below.&lt;/p&gt;

&lt;h3&gt;
  
  
  Querying the Storyblok API
&lt;/h3&gt;

&lt;p&gt;In any of your Astro pages, you can now use the &lt;code&gt;useStoryblokApi&lt;/code&gt; function to fetch data from Storyblok. In this example, we're retrieving the home Story:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;---&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useStoryblokApi&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@storyblok/astro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;StoryblokComponent&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@storyblok/astro/StoryblokComponent.astro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;storyblokApi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useStoryblokApi&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;storyblokApi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cdn/stories/home&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;draft&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;story&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;story&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;---&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;StoryblokComponent&lt;/span&gt; &lt;span class="nx"&gt;blok&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;{story.content}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating Astro Components
&lt;/h3&gt;

&lt;p&gt;For each Astro component that should be linked to its equivalent in your Storyblok Space, you can use the storyblokEditable() function on its root element, passing the blok property that they receive and enabling communication with the Storyblok Bridge. Furthermore, you can use the StoryblokComponent to dynamically load any of the components that you registered globally.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;---&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;storyblokEditable&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@storyblok/astro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;StoryblokComponent&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@storyblok/astro/StoryblokComponent.astro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;blok&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Astro&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;
&lt;span class="o"&gt;---&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt; &lt;span class="p"&gt;{...&lt;/span&gt;&lt;span class="nf"&gt;storyblokEditable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blok&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;blok&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blok&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;StoryblokComponent&lt;/span&gt; &lt;span class="nx"&gt;blok&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;{blok}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;})}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/main&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  ...but what about partial hydration?
&lt;/h4&gt;

&lt;p&gt;We've got you covered! Being able to bring your favorite framework and benefitting from partial hydration is a huge advantage of using Astro.&lt;/p&gt;

&lt;p&gt;If you want to use partial hydration with any of the &lt;a href="https://docs.astro.build/en/guides/integrations-guide/#article" rel="noopener noreferrer"&gt;frameworks supported by Astro&lt;/a&gt;, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.astro.build/en/guides/integrations-guide/#automatic-integration-setup" rel="noopener noreferrer"&gt;Install the official Astro integration for your desired framework&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create an Astro component that serves as a wrapper and utilizes the most suitable &lt;a href="https://docs.astro.build/en/reference/directives-reference/#client-directives" rel="noopener noreferrer"&gt;client directive&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create the actual component in Vue, Svelte, React or any other supported framework&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For working examples, you can explore the &lt;a href="https://stackblitz.com/edit/astro-sdk-demo" rel="noopener noreferrer"&gt;Live Demo on Stackblitz&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enabling the Storyblok Bridge
&lt;/h3&gt;

&lt;p&gt;The Storyblok Bridge is automatically activated by default. If you would like to disable it or enable it conditionally (e.g. depending on the environment) you can set the &lt;code&gt;bridge&lt;/code&gt; parameter to &lt;code&gt;false&lt;/code&gt; in &lt;code&gt;astro.config.mjs&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Since Astro is not a reactive JavaScript framework and renders everything as HTML, the Storyblok Bridge will not provide real-time editing as you may know it from other frameworks. However, it automatically refreshes the site for you whenever you save or publish a story.&lt;/p&gt;

&lt;p&gt;And that’s it! Your Astro project is now fully integrated with the Storyblok CMS.&lt;/p&gt;

&lt;p&gt;Have a look at &lt;a href="https://github.com/storyblok/storyblok-astro" rel="noopener noreferrer"&gt;@storyblok/astro&lt;/a&gt; for more detailed documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next Steps
&lt;/h2&gt;

&lt;p&gt;Are you excited to try it out? We would &lt;em&gt;love&lt;/em&gt; to see your projects built with Storyblok and Astro!&lt;/p&gt;

&lt;p&gt;We are planning to release a complete &lt;em&gt;Storyblok Astro Ultimate Tutorial&lt;/em&gt; in which you will learn how to build a feature-rich, multilingual website.&lt;/p&gt;

&lt;p&gt;Would you like to contribute to the development of &lt;a href="https://github.com/storyblok/storyblok-astro" rel="noopener noreferrer"&gt;@storyblok/astro&lt;/a&gt;? Feel free to create an issue or a PR in the official GitHub repository.&lt;/p&gt;

</description>
      <category>astro</category>
      <category>sdk</category>
      <category>integration</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Storyblok SDKs for Vue 2 and 3 – now with TypeScript support</title>
      <dc:creator>Manuel Schröder</dc:creator>
      <pubDate>Mon, 20 Jun 2022 10:52:04 +0000</pubDate>
      <link>https://dev.to/storyblok/storyblok-sdks-for-vue-2-and-3-now-with-typescript-support-764</link>
      <guid>https://dev.to/storyblok/storyblok-sdks-for-vue-2-and-3-now-with-typescript-support-764</guid>
      <description>&lt;p&gt;Over the last couple of days, we have been working hard to improve our Vue SDKs. We are thrilled to announce that &lt;a href="https://github.com/storyblok/storyblok-vue" rel="noopener noreferrer"&gt;@storyblok/vue&lt;/a&gt; and&lt;a href="https://github.com/storyblok/storyblok-vue-2" rel="noopener noreferrer"&gt;@storyblok/vue-2&lt;/a&gt; now come with TypeScript support!&lt;/p&gt;

&lt;p&gt;Would you like to see it in action? We have created a &lt;a href="https://stackblitz.com/edit/vue-sdk-ts-demo" rel="noopener noreferrer"&gt;Storyblok Vue SDK w/ TypeScript live demo&lt;/a&gt; for you!&lt;/p&gt;

&lt;p&gt;Not sure how to start? Here's our easy-to-follow tutorial: &lt;a href="https://www.storyblok.com/tp/add-a-headless-CMS-to-vuejs-in-5-minutes" rel="noopener noreferrer"&gt;How to add Storyblok to your Vue project in 5 minutes&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With the addition of TypeScript support, you now get to enjoy auto-completion, static typing and warnings when using either of the two Vue SDKs. This results in a significantly improved developer experience – even if you don't actually use TypeScript.&lt;/p&gt;

&lt;p&gt;But have a look for yourself:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fa.storyblok.com%2Ff%2F88751%2F2048x1152%2F1f2959c388%2Fvue-ts.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fa.storyblok.com%2Ff%2F88751%2F2048x1152%2F1f2959c388%2Fvue-ts.gif" alt="https://a.storyblok.com/f/88751/2048x1152/1f2959c388/vue-ts.gif" width="600" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are unsure how to set up a a Vue project in combination with TypeScript, you can learn more about this topic &lt;a href="https://vuejs.org/guide/typescript/overview.html" rel="noopener noreferrer"&gt;in the official docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We intend to roll out TypeScript support for all of our other SDKs soon – so stay tuned!&lt;/p&gt;

&lt;p&gt;Finally, we'd love to hear what you think about this latest update. What do you like about it and what could do to improve it even further?&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>dx</category>
      <category>vue</category>
      <category>storyblok</category>
    </item>
    <item>
      <title>Storyblok CheatSheet for Nuxt 3</title>
      <dc:creator>Manuel Schröder</dc:creator>
      <pubDate>Fri, 03 Jun 2022 09:44:37 +0000</pubDate>
      <link>https://dev.to/storyblok/storyblok-cheatsheet-for-nuxt-3-197f</link>
      <guid>https://dev.to/storyblok/storyblok-cheatsheet-for-nuxt-3-197f</guid>
      <description>&lt;p&gt;We have created a Storyblok Nuxt 3 CheatSheet for you! It provides all the information you need to get started right away.&lt;/p&gt;

&lt;p&gt;Download the CheatSheet to have a quick and concise overview on how to configure our SDK, create Storyblok components, render pages dynamically, fetch multilingual content and much more!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://a.storyblok.com/f/88751/x/f08e494225/cs-nuxt3.pdf" rel="noopener noreferrer"&gt;Download the Nuxt 3 CheatSheet&lt;/a&gt;&lt;/p&gt;

</description>
      <category>headless</category>
      <category>nuxt</category>
      <category>vue</category>
      <category>sdk</category>
    </item>
    <item>
      <title>New SDK naming for Nuxt 2 and Nuxt 3</title>
      <dc:creator>Manuel Schröder</dc:creator>
      <pubDate>Mon, 23 May 2022 09:57:58 +0000</pubDate>
      <link>https://dev.to/storyblok/new-sdk-naming-for-nuxt-2-and-nuxt-3-42m7</link>
      <guid>https://dev.to/storyblok/new-sdk-naming-for-nuxt-2-and-nuxt-3-42m7</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft55fjkty3bufle9bs6t4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft55fjkty3bufle9bs6t4.jpg" alt="New SDK naming for Nuxt 2 and Nuxt 3" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have updated the naming of our Nuxt SDK npm packages! Since Nuxt 3 is currently in RC stage and will become the new default very soon, the default package for Nuxt 3 is now &lt;code&gt;@storyblok/nuxt&lt;/code&gt;. The package for Nuxt 2 is now &lt;code&gt;@storyblok/nuxt-2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Depending on which you want to use, you would &lt;code&gt;npm install&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;@storyblok/nuxt-2&lt;/code&gt; for Nuxt 2&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;@storyblok/nuxt&lt;/code&gt; for Nuxt 3&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of the SDK demos and getting-started repositories have been updated to reflect these changes. Expect more tutorial content for Nuxt 3 from our side over the next few weeks.&lt;/p&gt;

&lt;p&gt;We would like to apologize for the recent naming changes and are aware of the confusion this has created among the Vue and Nuxt communities respectively. No more changes are to be expected anytime soon. Thank you very much for your understanding, your feedback, and your patience.&lt;/p&gt;

</description>
      <category>nuxt</category>
      <category>sdk</category>
      <category>headless</category>
    </item>
  </channel>
</rss>
