<?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>Forem: likayeltsova</title>
    <description>The latest articles on Forem by likayeltsova (@likayeltsova).</description>
    <link>https://forem.com/likayeltsova</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%2F676252%2F9f265e20-3efb-4aff-b023-d11cdd242b15.png</url>
      <title>Forem: likayeltsova</title>
      <link>https://forem.com/likayeltsova</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/likayeltsova"/>
    <language>en</language>
    <item>
      <title>Hooking-up a headless CMS to React apps</title>
      <dc:creator>likayeltsova</dc:creator>
      <pubDate>Fri, 02 Feb 2024 08:31:54 +0000</pubDate>
      <link>https://forem.com/flotiq/hooking-up-a-headless-cms-to-react-apps-19d6</link>
      <guid>https://forem.com/flotiq/hooking-up-a-headless-cms-to-react-apps-19d6</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Info&lt;br&gt;
This article shows how to hook up the React version of classical TodoMVC app to a Content Management System and use it to store data. After completing this tutorial, you will have a basic Todo application using React, which will sync its data into a cloud-based Content Management System.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;When we’re building web applications, we always hit the problem of storing data somewhere - should it be a database or a file on a cloud storage or something else? Frontend developers, in particular, don’t usually like to play around with setting up servers or AWS services to support their apps. Using a headless CMS is a perfect option in that case. In this short tutorial we will go through setting up Flotiq headless CMS to make it super easy to connect our React application and use it as a permanent data store.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Basic JavaScript knowledge&lt;/li&gt;
&lt;li&gt;Interest in React :)&lt;/li&gt;
&lt;li&gt;Headless CMS account, we will use Flotiq headless CMS for React (a free account will be just fine)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  TodoMVC
&lt;/h2&gt;

&lt;p&gt;TodoMVC is one of the most popular projects on GitHub and has been used by thousands of developers as an introduction to different frontend frameworks.&lt;/p&gt;

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

&lt;p&gt;Let’s start with getting this up and running, and it’s straightforward.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clone the repo
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone --depth=1 https://github.com/tastejs/todomvc.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Navigate to the React example
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd todomvc/examples/react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install the dependencies
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start the project!
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn run dev

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your browser should now open and display the TodoMVC app, and you can start adding tasks:&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;Let’s now have a look at the files of this project. It’s really simple, and you can start by looking at the app.jsx file, which will help you understand what’s going on in the application:&lt;/p&gt;

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

&lt;p&gt;The app uses the useReducer hook to manage the state. It’s a simple yet elegant way of dealing with an application state through events. It forces us to structure our code in a cleaner way without directly accessing the state with each user interaction. All state-handling logic is centralised and stored in a component called the reducer.&lt;/p&gt;

&lt;p&gt;If you check the reducer.js file, you will see that it follows the best practices for writing reducers :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it’s restricted to a bare minimum&lt;/li&gt;
&lt;li&gt;it doesn’t call any external entities&lt;/li&gt;
&lt;li&gt;it replaces the state instead of mutating it&lt;/li&gt;
&lt;li&gt;it uses a switch over the action.type field&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;We will keep that in mind when connecting to the CMS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data model &amp;amp; a headless CMS
&lt;/h2&gt;

&lt;p&gt;Items are the only model in the TodoMVC app, and their model is quite simple:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;id&lt;/code&gt; - a unique identifier of the item,&lt;br&gt;
&lt;code&gt;title&lt;/code&gt; - a text field containing the title,&lt;br&gt;
&lt;code&gt;completed&lt;/code&gt; - a boolean flag stating if the item is completed or not.&lt;/p&gt;

&lt;p&gt;Before we connect the React application with our backend - we need to set up the data model in Flotiq. Let’s do it now.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Login to Flotiq, you can register a &lt;a href="https://beta.flotiq.com/register?_gl=1*mzcmp3*_ga*NDQyOTQwOTY1LjE3MDU1MTI1Mzg.*_ga_155L75RSLX*MTcwNjYwNjE5NC4yMS4xLjE3MDY2MDY4ODEuNjAuMC4w"&gt;free Flotiq account&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once logged in - create a new Content Type Definition, follow &lt;a href="https://beta.flotiq.com/content-type-definitions/add?_gl=1*mzcmp3*_ga*NDQyOTQwOTY1LjE3MDU1MTI1Mzg.*_ga_155L75RSLX*MTcwNjYwNjE5NC4yMS4xLjE3MDY2MDY4ODEuNjAuMC4w"&gt;this link&lt;/a&gt; or click on&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Definition builder&lt;/strong&gt; in the left sidebar menu&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Add definition type&lt;/strong&gt; in the top right corner&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Design the model:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set the Label to &lt;code&gt;Item&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make sure the API Name is set to &lt;code&gt;item&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add a new text property &lt;code&gt;title&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

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

&lt;ol&gt;
&lt;li&gt;Add a checkbox called &lt;code&gt;completed&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;ol&gt;
&lt;li&gt;Click on the &lt;code&gt;Save&lt;/code&gt; button in the top right corner to add the Content Type to the system.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;The end result should look like this:&lt;/p&gt;

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

&lt;p&gt;Good job! At this point, your Flotiq account is ready to accept data from the application!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip&lt;br&gt;
Please note, that we did not explicitly create an id field in the system. Flotiq creates that for us automatically. When we create new objects we will have 2 options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;submit them with an ID that we define, or&lt;/li&gt;
&lt;li&gt;let Flotiq fill-in the id field with autogenerate values.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Connecting React with Flotiq
&lt;/h2&gt;

&lt;p&gt;Now, let’s finally make our todo items persistent! We will implement the following connections between the React TodoMVC app and Flotiq:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;creating new items in TodoMVC should create objects in the CMS&lt;/li&gt;
&lt;li&gt;toggling the item’s completion state should also be reflected in the CMS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt; - there are many other ways to achieve the same result! Please let us know in the comments if you can come up with other interesting ideas!&lt;/p&gt;
&lt;h2&gt;
  
  
  Adding new items
&lt;/h2&gt;

&lt;p&gt;The simplest way to achieve that, without breaking the reducer, is to add an API call to Flotiq before a state update event is dispatched. Let’s make these simple changes in app.jsx:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install node-fetch
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save node-fetch@2

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Add the useCallback import in the first line of app.jsx:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useReducer, useCallback } from "react";

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Import node-fetch
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import fetch from "node-fetch";

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Add the FLOTIQ_API_KEY const right after the imports (Check this documentation on &lt;a href="https://flotiq.com/docs/API/?h=api+key#application-api-keys"&gt;how to obtain a Flotiq API key&lt;/a&gt;).
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const FLOTIQ_API_KEY = 'PUT YOUR READ-WRITE KEY HERE';

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Finally, add the preDispatch function in app.jsx&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Find this in app.jsx:

export function App() {
const [todos, dispatch] = useReducer(todoReducer, []);

// Add this:
const preDispatch = useCallback( async (action) =&amp;gt; {

        if(action.type == 'ADD_ITEM'){

            const options = {
                method: 'POST',
                headers: {'content-type': 'application/json', 'X-AUTH-TOKEN': FLOTIQ_API_KEY},
                body: JSON.stringify({title: action.payload.title, completed: false}),
            };

            // Create the object in Flotiq
            const res = await fetch('https://api.flotiq.com/api/v1/content/item', options);
            // Retrieve the response to get the object ID
            const data = await res.json();
            // Add the ID as part of payload for the reducer            
            action.payload.id = data.id;           

        }

        dispatch(action);

    }, []);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Success&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Did you know that Flotiq automatically publishes a set of OpenAPI-compliant endpoints for the content model you define? On top of that there is more - Postman collection, SDKs and API docs, where you can find code snippets that you can simply copy from Flotiq directly into your project!&lt;/p&gt;

&lt;p&gt;Click on the &lt;code&gt;API Docs&lt;/code&gt; Link in your Flotiq dashboard:&lt;/p&gt;

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

&lt;p&gt;Find the endpoint that you need and copy the code. That’s what I did to build this tutorial :-)&lt;/p&gt;

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

&lt;p&gt;Pass &lt;code&gt;preDispatch&lt;/code&gt; instead of dispatch to the &lt;code&gt;Header&lt;/code&gt; and &lt;code&gt;Main&lt;/code&gt; components:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   return (
        &amp;lt;&amp;gt;
            &amp;lt;Header dispatch={preDispatch} /&amp;gt;
            &amp;lt;Main todos={todos} dispatch={preDispatch} /&amp;gt;
            &amp;lt;Footer todos={todos} dispatch={dispatch} /&amp;gt;
        &amp;lt;/&amp;gt;
    );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Last thing - we need to update the existing reducer to support IDs that are generated outside of the reducer itself:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    switch (action.type) {
        case ADD_ITEM:
            return state.concat({ id: action.payload.id === undefined ? nanoid() : action.payload.id, title: action.payload.title, completed: false });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this, you should now see new items appear in Flotiq while you add them in your TodoMVC!&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Toggling item state
&lt;/h2&gt;

&lt;p&gt;We will need to add a couple more changes to synchronise the completion state. The &lt;code&gt;preDispatch&lt;/code&gt; function will have to handle another type of action: TOGGLE_ITEM, and we will also have to fetch the current state of the toggle so we can send it to Flotiq. Here’s the complete updated &lt;code&gt;preDispatch&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    const preDispatch = useCallback( async (action) =&amp;gt; {

        if(action.type == 'ADD_ITEM'){

            const options = {
                method: 'POST',
                headers: {'content-type': 'application/json', 'X-AUTH-TOKEN': RW_AUTH_TOKEN},
                body: JSON.stringify({title: action.payload.title, completed: false}),
            };

            const res = await fetch('https://api.flotiq.com/api/v1/content/item', options);
            const data = await res.json();
            action.payload.id = data.id;           

        } else if (action.type == 'TOGGLE_ITEM'){

            // Find the toggled item, so we know its state
            const item = todos.find( (item)=&amp;gt;{
                return item.id == action.payload.id
            });


            const options = {
                method: 'PATCH',
                headers: {'content-type': 'application/json', 'X-AUTH-TOKEN': RW_AUTH_TOKEN},
                body: JSON.stringify({id: action.payload.id, completed: !item.completed}), // negate current value of completed
            };

            const res = await fetch('https://api.flotiq.com/api/v1/content/item/' + action.payload.id, options);
            const data = await res.json();

        }


        dispatch(action);        

    }, [todos]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it! You will now see the state of the completed checkbox change in the CMS every time you make an update in your app:&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this short walkthrough, we demonstrated how to run the React version of the classic TodoMVC project. We then integrated it with a cloud-hosted CMS, where the data is persisted and can be accessed whenever we want.&lt;/p&gt;

&lt;p&gt;Next steps? Fetch the list of todo items from Flotiq when the application starts!&lt;/p&gt;

&lt;p&gt;Follow us to get notified about our next article, where we will complete the demo.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>java</category>
      <category>react</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>📣 Exciting Update: Introducing the version of the "Equals" Filter in Flotiq Headless CMS! 🚀</title>
      <dc:creator>likayeltsova</dc:creator>
      <pubDate>Fri, 23 Jun 2023 05:38:41 +0000</pubDate>
      <link>https://forem.com/flotiq/exciting-update-introducing-the-version-of-the-equals-filter-in-flotiq-headless-cms-1p65</link>
      <guid>https://forem.com/flotiq/exciting-update-introducing-the-version-of-the-equals-filter-in-flotiq-headless-cms-1p65</guid>
      <description>&lt;p&gt;We're thrilled to announce a powerful new feature in Flotiq headless CMS that will revolutionize your content filtering experience. Introducing the possibility where you can pass multiple items in the "Equals" filter, designed to provide even greater flexibility and control when querying your data.&lt;/p&gt;

&lt;p&gt;🔎 What is the "Equals" Filter?&lt;br&gt;
The "Equals" filter allows you to pass multiple elements as a filter, ensuring that the results match any of the specified values. This means you can now easily retrieve content that corresponds to a specific set of criteria in a single API request.&lt;/p&gt;

&lt;p&gt;🌟 How Does it Work?&lt;br&gt;
Let's dive into an example to illustrate the capabilities of the "Equals" filter:&lt;/p&gt;

&lt;p&gt;Suppose you have a "name" field in your content type, and you want to fetch all the products with names "product-1" or "product-2." With the "Equals" filter, you can simply use the following API query.&lt;/p&gt;

&lt;p&gt;Before:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{"name":{"type":"equals", "filter":"product-1"}}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{"name":{"type":"equals", "filter":["product-1", "product-2"]}}&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
By leveraging this new filter, you can effortlessly retrieve the desired results without making multiple requests or complex workarounds.&lt;/p&gt;

&lt;p&gt;📚 Want to Learn More?&lt;br&gt;
To explore the full potential of the "Equals" filter and its usage scenarios, we encourage you to check out our comprehensive documentation. You'll find detailed information, code examples, and practical insights on incorporating this feature into your Flotiq headless CMS workflow.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://flotiq.com/docs/API/content-type/listing-co/"&gt;Learn More about the "Equals" Filter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✨ If you have any questions, need assistance, or want to share your feedback, our dedicated team is here to help you every step of the way.&lt;/p&gt;

&lt;p&gt;Thank you for choosing &lt;a href="https://flotiq.com/"&gt;Flotiq&lt;/a&gt; headless CMS as your trusted content management solution. We're excited to see how the "Equals" filter simplifies and empowers your content querying!&lt;/p&gt;

&lt;p&gt;Happy Filtering! 🎉&lt;/p&gt;

</description>
      <category>headlesscms</category>
      <category>api</category>
      <category>query</category>
      <category>datafiltering</category>
    </item>
    <item>
      <title>Use data from Flotiq in React and Typescript projects</title>
      <dc:creator>likayeltsova</dc:creator>
      <pubDate>Thu, 04 May 2023 10:33:24 +0000</pubDate>
      <link>https://forem.com/flotiq/use-data-from-flotiq-in-react-and-typescript-projects-21lk</link>
      <guid>https://forem.com/flotiq/use-data-from-flotiq-in-react-and-typescript-projects-21lk</guid>
      <description>&lt;p&gt;This article demonstrates a TypeScript-based approach to React components hydrated with data coming from &lt;a href="http://flotiq.com/"&gt;Flotiq&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this short article, we will show how to set up a Flotiq content type and use your OpenAPI schema to generate a Typescript-compatible API client that will integrate seamlessly with your Next.js project. As a result, you will be able to consume any data you store in Flotiq in Next.js with benefits like code completion in your IDE.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://editor.flotiq.com/register.html"&gt;Flotiq account&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;basic Typescript and React knowledge.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create a content type in Flotiq
&lt;/h2&gt;

&lt;p&gt;Start with a simple content type, for example, one that represents a Hero section in your website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V0sEa3um--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ievksdq7nujsrgz8b5yk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V0sEa3um--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ievksdq7nujsrgz8b5yk.png" alt="typescript with flotiq data" width="800" height="683"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;once you create the content type definition — go ahead and add some objects too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create NextJS project
&lt;/h2&gt;

&lt;p&gt;Next, use the &lt;code&gt;create-next-app&lt;/code&gt; to setup a fresh Next.js project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-next-app@latest flotiq-component-demo --typescript --eslint
cd flotiq-component-demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read more about &lt;a href="https://nextjs.org/docs/api-reference/create-next-app"&gt;create-next-app here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Export Flotiq API and build the API package
&lt;/h2&gt;

&lt;p&gt;When the Next.js project is already up and running you will now connect it to your Flotiq API. Start by exporting the API definition into a file. You will need your read-only API key to do this — &lt;a href="https://flotiq.com/docs/API/?h=api+key#application-api-keys"&gt;here’s how to get it.&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export FLOTIQ_RO_API_KEY=&amp;lt;YOUR_RO_API_KEY_HERE&amp;gt;
curl -X GET "https://api.flotiq.com/api/v1/open-api-schema.json?hydrate=1" -H "X-Auth-Token: ${FLOTIQ_RO_API_KEY}" &amp;gt; oas.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will save your OpenAPI definition into a file called &lt;code&gt;oas.json&lt;/code&gt; in your current directory. Next - you will process that file with &lt;code&gt;openapi-generator&lt;/code&gt; to build the API client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run --rm -it -v "${PWD}:/tmp" \
       --workdir /tmp openapitools/openapi-generator-cli \
       generate -i /tmp/oas.json -g typescript-node -o /tmp/flotiq-api \
       --additional-properties=modelPropertyNaming=original,paramNaming=original,withNodeImports=true,supportsES6=true,npmName=component-api,npmVersion=0.1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will save the API in &lt;code&gt;flotiq-api&lt;/code&gt; directory, so you now have to move the built API into its proper location (note that the target path will change if you are not using NextJS &lt;code&gt;src&lt;/code&gt; and &lt;code&gt;app&lt;/code&gt; directories):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mv flotiq-api ./src/app/flotiq
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Use the API
&lt;/h2&gt;

&lt;p&gt;We’re almost done! Now you have to edit 2 files in the NextJS repo: 1. &lt;code&gt;src/app/page.tsx&lt;/code&gt; and 2. &lt;code&gt;src/app/components/hero.tsx&lt;/code&gt; (new file) to start using the API.&lt;/p&gt;

&lt;p&gt;Let’s start with &lt;code&gt;page.tsx&lt;/code&gt;. First, we need to connect to Flotiq API, add the following lines to your file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// add this at the beginning of the file, with other imports
import { ContentHeroApi, ContentHeroApiApiKeys, HeroList } from './flotiq/api'

const FLOTIQ_API_URL = "https://api.flotiq.com";
const FLOTIQ_API_KEY = "&amp;lt;YOUR_RO_API_KEY_HERE&amp;gt;"; // RO

async function getData() : HeroList {
  const heroApi = new ContentHeroApi(FLOTIQ_API_URL);
  heroApi.setApiKey(ContentHeroApiApiKeys.HeaderApiKeyAuth, FLOTIQ_API_KEY);
  // let's fetch all sections and make sure we hydrate them 
  const {body: list} = await heroApi.listHero(undefined, undefined, undefined, undefined, 1)
  return list;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;next, let’s update the &lt;code&gt;Home()&lt;/code&gt; component to display all the sections found:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default async function Home() {
  const list = await getData();
  return (
    &amp;lt;main&amp;gt;
      &amp;lt;div className="bg-white py-24 sm:py-32"&amp;gt;
          {list.data?.map(function(section, index){

              return &amp;lt;HeroComponent hero={section}&amp;gt;&amp;lt;/HeroComponent&amp;gt;
            })
          }
          &amp;lt;/div&amp;gt;
    &amp;lt;/main&amp;gt;
  )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now, let’s create that &lt;code&gt;HeroComponent&lt;/code&gt; in the &lt;code&gt;src/app/components/hero.tsx&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Hero } from "../flotiq/api";
interface HeroProps {
  hero: Hero
}
export default function HeroComponent({hero} : HeroProps){
    return (
            &amp;lt;div&amp;gt;
             &amp;lt;h3&amp;gt;
                 {hero.lead_text}
             &amp;lt;/h3&amp;gt;
            &amp;lt;/div&amp;gt;
    );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it! Start using TypeScript with Flotiq data. By now you probably noticed how convenient it is to have explicit typing and code completion in your editor:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--py12wT5T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vp38r0viwauopd1ul6ze.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--py12wT5T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vp38r0viwauopd1ul6ze.png" alt="Flotiq adding content type" width="800" height="615"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>react</category>
      <category>headlesscms</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to design headless component</title>
      <dc:creator>likayeltsova</dc:creator>
      <pubDate>Mon, 03 Apr 2023 12:45:58 +0000</pubDate>
      <link>https://forem.com/flotiq/how-to-design-headless-component-1m6h</link>
      <guid>https://forem.com/flotiq/how-to-design-headless-component-1m6h</guid>
      <description>&lt;p&gt;Headless CMS can store raw data about products, stock, people, books or whatever else. But it can also hold information about the structure of pages on a website. Without sacrificing the benefits of a headless approach - we can also provide users with familiar and easy-to-use tools to control the appearance of their content and foster the reuse of existing material. In this article, we will look at an approach to how to structure headless CMS-based websites and design the content model to support these goals.&lt;/p&gt;

&lt;h2&gt;
  
  
  Information Architecture
&lt;/h2&gt;

&lt;p&gt;What comes first in every headless CMS-based project is the information architecture. This means - your data model. There are 2 common patterns for designing the model:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Model built around raw data, e.g. products and stock&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Model that also represents concepts like pages and their content.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;While the first approach is absolutely correct, the second can easily become an anti-pattern of a headless CMS application. Let’s look a bit deeper into the pros &amp;amp; cons of both.&lt;/p&gt;

&lt;p&gt;Raw data pattern&lt;br&gt;
In the raw data pattern, we make great efforts to eliminate (or at least greatly reduce) any signs of the presentation layer in our data model. Some models we might see in a project would be:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;product&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;id: number&lt;/li&gt;
&lt;li&gt;price: number&lt;/li&gt;
&lt;li&gt;name: text&lt;/li&gt;
&lt;li&gt;description: text&lt;/li&gt;
&lt;li&gt;image: URL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;invoice&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;id: number&lt;/li&gt;
&lt;li&gt;date: date&lt;/li&gt;
&lt;li&gt;amount: number&lt;/li&gt;
&lt;li&gt;customer: object&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is done for a good purpose - the more sauté our data, the easier it will be to repurpose for different channels. What you display in a web browser today might end up on your smartwatch tomorrow. Reusing that content on a different device becomes relatively easy once we get rid of HTML or other forms describing how the content should be displayed. That’s, in fact, one of the main selling points of headless CMSs. Drawbacks? The headless Content Management System in reality, becomes a very thin frontend to a database. Is it bad? Not necessarily. Does it help content editors work with the content? To some extent - yes. But in this case, 100% of the description of how this content is displayed on a website (for example) has to be defined in code. This, in turn, means that any change to what is displayed on the website requires a developer to change that code and redeploy the application. This isn’t what customers used to platforms like Wix, WordPress or Adobe Experience Manager want to see. They expect at least some level of control and the ability to perform changes on a website without constantly engaging development teams.&lt;/p&gt;
&lt;h2&gt;
  
  
  Visual model
&lt;/h2&gt;

&lt;p&gt;Quite the opposite approach, one which tries to address the need to easily perform changes on the website, is to include a description of the visual representation of our content in the headless data model. What we might find in a project that follows this path is, for example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;page&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;title: text&lt;/li&gt;
&lt;li&gt;URL: text&lt;/li&gt;
&lt;li&gt;keywords: text&lt;/li&gt;
&lt;li&gt;header: rich text&lt;/li&gt;
&lt;li&gt;mainContent: rich text&lt;/li&gt;
&lt;li&gt;footer: rich text.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Depending on the features provided by the headless CMS - content editors may have quite a bit of control over how the content is structured and rendered on a page. For example, Flotiq [link do flotiq.com] offers a block editor that allows authoring page sections using structured content blocks.&lt;/p&gt;

&lt;p&gt;This approach, unfortunately, is very close to a headless CMS anti-pattern. Content stored in pages structured this way will likely be unusable in any channel except a website. Let’s look at an example page object represented in JSON:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "title": "About us",
  "url": "/about-us",
  "keywords": "company information",
  "header": "&amp;lt;h1&amp;gt;ACME company information page&amp;lt;/h1&amp;gt;",
  "mainContent": "&amp;lt;h2&amp;gt;Company history&amp;lt;/h2&amp;gt;&amp;lt;img src=\"/media/team-photo.jpg\" alt=\"Our team in 2022 has grown to 20 people!\"/&amp;gt;&amp;lt;p&amp;gt;Our company has been founded in 1999, just before Y2K.&amp;lt;/p&amp;gt;",
  "footer": "&amp;lt;span style=\"font-size:8pt\"&amp;gt;Call us at +1 (123) 456-789&amp;lt;/span&amp;gt;"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now - this will be easily rendered in a web browser, but what about a watch? Or what if you would like to send the company history information to a mobile phone in a text message? You will have to strip all the HTML, possibly removing some important information (like the contents of the alt attribute in the example above). Actually, you won’t even be able to reuse the information about company history on another page of your website - you would have to copy the entire page and only then start making adjustments. You will end up with a similar situation when using visual website builders.&lt;/p&gt;

&lt;h2&gt;
  
  
  Headless visual pattern
&lt;/h2&gt;

&lt;p&gt;A sweet spot can be found between the 2 models above. A way to keep both - the editors wanting some flexibility and influence on the presentation layer and orthodox headless purists - happy. Let’s consider a specific example of a website selling tea. The basic data type, in this case, would be:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;product&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;id: number&lt;/li&gt;
&lt;li&gt;name: text&lt;/li&gt;
&lt;li&gt;description: text&lt;/li&gt;
&lt;li&gt;kind: {green, black}&lt;/li&gt;
&lt;li&gt;price: number&lt;/li&gt;
&lt;li&gt;image: url&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;order&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;id: number&lt;/li&gt;
&lt;li&gt;date: date&lt;/li&gt;
&lt;li&gt;customerAddress: text&lt;/li&gt;
&lt;li&gt;orderedProductId: number&lt;/li&gt;
&lt;li&gt;quantity: number&lt;/li&gt;
&lt;li&gt;totalPaid: number&lt;/li&gt;
&lt;li&gt;shipmentStatus: text&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;and providing this to content editors via a Headless CMS will allow them to easily add and update products and track orders. A very simple product detail page might look similar to the following (the code examples below are incomplete but are inspired by Next.js components):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default function Product({ product }) {
  return (
    &amp;lt;div style="background-color: green"&amp;gt;
      &amp;lt;h1&amp;gt;{product.name}&amp;lt;/h1&amp;gt;
      &amp;lt;img src="{product.image}"/&amp;gt;
      &amp;lt;span&amp;gt;&amp;lt;b&amp;gt;Price&amp;lt;/b&amp;gt;{product.price}&amp;lt;/span&amp;gt;
      &amp;lt;button&amp;gt;Buy&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s really straightforward. But will a content editor happily clone a Git repo, open up an IDE and change the background color of this page? Nope. So can we do anything about it?&lt;/p&gt;

&lt;h2&gt;
  
  
  Defining the architecture
&lt;/h2&gt;

&lt;p&gt;In some cases, this might be an iterative process, but it usually starts with a simple question - what do you expect to update on the site, and how frequently will you do it? Based on the answers to these questions, you will end up creating more or less complex content architecture. To address the situation in the example above - one might include in their content model (on top of the product and order content types) a productCard the model defined like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;productCard&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;id: number&lt;/li&gt;
&lt;li&gt;productId: number&lt;/li&gt;
&lt;li&gt;cardBackground: text&lt;/li&gt;
&lt;li&gt;and the component would instantly become:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default function Product({ product, productCard }) {
  return (
    &amp;lt;div style="background-color: {productCard.cardBackground}"&amp;gt;
      &amp;lt;h1&amp;gt;{product.name}&amp;lt;/h1&amp;gt;
      &amp;lt;img src="{product.image}"/&amp;gt;
      &amp;lt;span&amp;gt;&amp;lt;b&amp;gt;Price&amp;lt;/b&amp;gt;{product.price}&amp;lt;/span&amp;gt;
      &amp;lt;button&amp;gt;Buy&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This mix of content types originating from the raw data model and ones more related to the visual representation is really powerful if you think about it. Let’s consider that on our website, we also have a number of informational pages which describe the process of growing tea, packaging it and brewing it. Our UI designer created a modern minimalistic design based on 2 kinds of sections:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Rh-Bd7Y8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hq6qu782duln8op41joq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rh-Bd7Y8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hq6qu782duln8op41joq.png" alt="Simple section - UX design" width="747" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Content in these sections is text and a related image, but we already know there will be situations when the editors might want to visually emphasise some of these descriptions. How could we organize this in a headless CMS? Let’s look at an example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;order&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;id: number&lt;/li&gt;
&lt;li&gt;name: text&lt;/li&gt;
&lt;li&gt;variant: {leftTextRightImage, leftImageRightText}&lt;/li&gt;
&lt;li&gt;heading: text&lt;/li&gt;
&lt;li&gt;content: text&lt;/li&gt;
&lt;li&gt;image: URL&lt;/li&gt;
&lt;li&gt;backgroundColor: text&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;page&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;id: number&lt;/li&gt;
&lt;li&gt;URL: text&lt;/li&gt;
&lt;li&gt;title: text&lt;/li&gt;
&lt;li&gt;content: array of linked section objects.
In the section content type we’ve identified several important patterns:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;a) sections can have the image on either side but otherwise are the same,&lt;/p&gt;

&lt;p&gt;b) background color should be changeable by the editors,&lt;/p&gt;

&lt;p&gt;c) heading text should be split from the rest to simplify the presentation.&lt;/p&gt;

&lt;p&gt;For the page content - we chose to compose the content of links to existing section objects (Flotiq supports relations/linking between objects of different content types). This way, sections can be used on different pages, and editors can even decide what goes on which page and in what order.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default function Section({ props } ) {
  return (
    &amp;lt;div style="background-color:{props.backgroundColor}; display:flex"&amp;gt;
      &amp;lt;div style="order: {props.variant == "leftTextRighImage" ? 1 : 2}"&amp;gt;
        &amp;lt;h1&amp;gt;{props.heading}&amp;lt;/h1&amp;gt;
        &amp;lt;span&amp;gt;{props.content}&amp;lt;/span&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;div style="order: {props.variant == "leftTextRighImage" ? 2 : 1}"&amp;gt;
        &amp;lt;img src="{props.image}"/&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}
 export default function Page({ page }) {
  return (
    {page.sections.map((section) =&amp;gt; (
        &amp;lt;Section section={section}/&amp;gt;
      ))}
  )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Data in Flotiq
&lt;/h2&gt;

&lt;p&gt;The example above can be implemented in Flotiq very quickly. Here are our content type definitions first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Section
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HLOHYhKl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d8lqn8vng3oh2ispy9p3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HLOHYhKl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d8lqn8vng3oh2ispy9p3.png" alt="Content type definition of a section" width="880" height="740"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Page
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zhDwUhob--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g4ba4v9xelpt6isc79a4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zhDwUhob--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g4ba4v9xelpt6isc79a4.png" alt="Content Type Definition of a page" width="880" height="689"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Objects
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1z-5C-Dl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihcdm722q2qai0pysqpt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1z-5C-Dl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihcdm722q2qai0pysqpt.png" alt="Example section" width="880" height="916"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the CTDS are in place, we can start creating content. Here’s an example section:&lt;/p&gt;

&lt;p&gt;and a page could be like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RauUHW6A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5dzxjoc1u0hq3c0pvc27.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RauUHW6A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5dzxjoc1u0hq3c0pvc27.png" alt="A page reusing existing section objects" width="880" height="611"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;The main selling point of headless CMS systems is the separation of data and the description of its presentation. Unfortunately, this split can hurt the authoring flow and create bottlenecks for the development team. At the same time - focusing on the presentation side can result in a data model that makes content reuse almost impossible. Fortunately, following the headless visual pattern, we are able to logically structure our content, map it onto code (i.e. React components) and equip content editors with tools to influence the presentation layer without making code changes.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>scalability</category>
      <category>ux</category>
      <category>headlesscms</category>
    </item>
    <item>
      <title>Top 10 Benefits of creating portfolio with Flotiq headless CMS in 2023</title>
      <dc:creator>likayeltsova</dc:creator>
      <pubDate>Wed, 01 Feb 2023 08:14:00 +0000</pubDate>
      <link>https://forem.com/flotiq/top-10-benefits-of-creating-portfolio-with-flotiq-headless-cms-in-2023-53dn</link>
      <guid>https://forem.com/flotiq/top-10-benefits-of-creating-portfolio-with-flotiq-headless-cms-in-2023-53dn</guid>
      <description>&lt;p&gt;Creating a portfolio can be a valuable tool for anyone looking to advance their career or establish themselves as a professional in their field. With the help of headless CMS like Flotiq, creating and maintaining an online portfolio can be done efficiently and effectively.&lt;/p&gt;

&lt;p&gt;Creating a portfolio online with a headless CMS can be easy and important. We want to provide you with several benefits of creating an online portfolio with Flotiq headless CMS and having a portfolio overall.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Flexibility: With a headless CMS, the content and presentation are decoupled, which means that you can easily change how your portfolio looks without affecting the content. You can also use different frontend frameworks or platforms to display your portfolio. Remember to check our &lt;a href="https://flotiq.com/starters/"&gt;starters&lt;/a&gt; for Gatbys and NextJS framework.&lt;/li&gt;
&lt;li&gt;Scalability: Flotiq headless CMS allows for easy scalability, as it does not rely on a specific presentation layer. As your portfolio grows, you can easily add new features or functionalities without affecting the existing content.&lt;/li&gt;
&lt;li&gt;Simplicity: Flotiq headless CMS provides a simple and user-friendly interface for managing your portfolio's content. It also comes with a wide range of pre-built templates and tools that make it easy to create, update and organize your portfolio. We are working on creating a new interface. Check the progress on our &lt;a href="https://flotiq.productlift.dev/t/roadmap"&gt;roadmap&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Security: Flotiq has built-in security features that allow you to control access to your content, ensuring that your portfolio's data remains safe and secure.&lt;/li&gt;
&lt;li&gt;Cross-platform compatibility: Headless CMS is built to be platform-agnostic, so you can easily share your portfolio across different platforms and devices.&lt;/li&gt;
&lt;li&gt;Speed and Performance: Flotiq headless CMS allows you to serve your content quickly and efficiently, as you can host your frontend and backend separately on different servers.&lt;/li&gt;
&lt;li&gt;Networking: An online portfolio can help you to connect with other professionals in your field and expand your network, which can lead to new opportunities and collaborations.&lt;/li&gt;
&lt;li&gt;Credibility: An online portfolio can help establish credibility and trustworthiness by visually representing your work and the results you have achieved.&lt;/li&gt;
&lt;li&gt;Showcasing your skills: An online portfolio allows you to showcase your skills and qualifications clearly, concisely and effectively, which can be a powerful tool for differentiating you from other candidates for a job or clients for service.&lt;/li&gt;
&lt;li&gt;Keeping your work up-to-date: An online portfolio allows you to easily update and add new projects to your portfolio, keeping it current and showcasing your most recent work.&lt;/li&gt;
&lt;li&gt;Using Flotiq headless CMS for creating your portfolio can provide you with a flexible, scalable, and easy-to-use platform for managing your content, saving you time and effort in the long run.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;While creating a portfolio with Flotiq headless CMS, you can use Next.js integration by providing an API that you can use to fetch your content from Flotiq and display it on your website or use Gatsby by providing a source plugin that you can use to fetch your content from Flotiq.&lt;/p&gt;

&lt;p&gt;So here are simple steps on how to create an online portfolio with Flotiq headless CMS:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://editor.flotiq.com/register.html"&gt;Sign up&lt;/a&gt; for a Flotiq account and create a new project.&lt;/li&gt;
&lt;li&gt;You can use one of our &lt;a href="https://github.com/flotiq/flotiq-nextjs-portfolio-2"&gt;starters&lt;/a&gt; created for the portfolio use cases, or you can define the content models for your portfolio. Our starters were created with content models for different types of content, such as projects, client testimonials, and personal information.&lt;/li&gt;
&lt;li&gt;Add your content to Flotiq. You can add content to your portfolio by creating new content entries in the Flotiq interface.&lt;/li&gt;
&lt;li&gt;Customize the design and layout of your portfolio, or use one of our starters.&lt;/li&gt;
&lt;li&gt;Publish your portfolio. Once you have completed the steps above, you can publish your portfolio to a hosting platform of your choice.&lt;/li&gt;
&lt;li&gt;In Flotiq, we have detailed &lt;a href="https://flotiq.com/docs/"&gt;documentation&lt;/a&gt; and &lt;a href="https://www.youtube.com/@flotiq8601"&gt;tutorials&lt;/a&gt; to help you create your portfolio, including information on how to customize your content models, retrieve content from the API and customize the look of your portfolio.&lt;/li&gt;
&lt;li&gt;Additionally, Flotiq provides a pre-built starter and set of blocks that allow you to create a portfolio easily and quickly.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Remember, having an online portfolio can be an essential tool for any professional looking to advance their career or grow their business. Using Flotiq headless CMS, creating and maintaining an online portfolio becomes an easy task that can be done efficiently and effectively.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why build an ecommerce store with Flotiq Headless CMS</title>
      <dc:creator>likayeltsova</dc:creator>
      <pubDate>Wed, 01 Feb 2023 07:57:56 +0000</pubDate>
      <link>https://forem.com/flotiq/why-build-an-ecommerce-store-with-flotiq-headless-cms-3bj</link>
      <guid>https://forem.com/flotiq/why-build-an-ecommerce-store-with-flotiq-headless-cms-3bj</guid>
      <description>&lt;p&gt;An e-commerce store built with Flotiq Headless CMS is a smart choice for businesses looking to increase their online presence and sales. With the ability to reach customers anywhere with an internet connection, you have the opportunity to expand your customer base beyond traditional physical locations. The convenience of shopping at any time, even outside of regular business hours, makes it easier for customers to make purchases, boosting your chances of making a sale. Choose Flotiq for a fast, secure, and scalable solution to your e-commerce needs&lt;/p&gt;

&lt;p&gt;Creating an online store allows businesses to reach a wider audience, as customers can access the store from anywhere with an internet connection. This can help businesses expand their customer base and increase sales. In addition, an online store can be accessible to customers 24 hours a day, 7 days a week, this can increase the chances of making a sale, as customers can shop at their own convenience, even outside of regular business hours. &lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of Building an Online Store with a Headless CMS
&lt;/h2&gt;

&lt;p&gt;Online stores can also be relatively cost-effective to set up and operate, as they do not require the expenses associated with maintaining a physical storefront. Personalization options, such as product recommendations based on browsing history and more detailed information about products, can also be offered. Furthermore, an online store can be a powerful tool for marketing, as it allows the use of various online marketing channels, such as email campaigns, social media, and SEO.&lt;/p&gt;

&lt;p&gt;Building an online store with a headless CMS can vary in terms of ease, depending on the specific CMS being used and the level of technical expertise of the person building the store.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flotiq as a Headless CMS for E-commerce
&lt;/h2&gt;

&lt;p&gt;Flotiq, as a headless CMS, provides an intuitive and user-friendly interface for creating and managing content models, which makes it relatively easy for non-technical users to set up an online store. Additionally, it offers pre-built e-commerce integrations with popular e-commerce platforms, which can speed up the process of building an online store.&lt;/p&gt;

&lt;p&gt;However, building the frontend of an online store can require some technical expertise, as it will involve using programming languages and frameworks to create the design and user interface of the store. This can be more challenging for those without prior experience in web development.&lt;/p&gt;

&lt;p&gt;In general, building an online store with a headless CMS such as Flotiq can be relatively easy for those with some technical knowledge, as it offers a user-friendly interface for managing content and integrations with popular e-commerce platforms. However, building the frontend of the online store may require more technical expertise.&lt;/p&gt;

&lt;p&gt;Building an ecommerce store with Flotiq headless CMS allows for greater flexibility and scalability in managing and displaying product information. As a headless CMS, Flotiq allows for easy integration with a variety of ecommerce platforms, and offers a user-friendly interface for managing and organizing product data. Additionally, using a headless CMS allows for more efficient and effective use of resources, as the frontend and backend can be developed and managed separately. Overall, using Flotiq as the CMS for an ecommerce store can provide benefits such as increased efficiency, flexibility and scalability in managing and displaying product information.&lt;/p&gt;

&lt;h2&gt;
  
  
  There are several benefits of having an online store built with a headless CMS
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Flexibility: A headless CMS allows for greater flexibility in terms of the frontend technology used to display product information, as the backend and frontend can be decoupled. This means that the online store can be built using any frontend technology, such as React, Vue, or Angular.&lt;/li&gt;
&lt;li&gt;Scalability: A headless CMS allows for easy scalability, as the frontend and backend can be developed and managed separately. This means that the online store can be easily scaled to accommodate a larger volume of products or a larger number of users.&lt;/li&gt;
&lt;li&gt;Improved performance: A headless CMS allows for more efficient use of resources, as the frontend and backend can be developed and managed separately. This means that the online store can be optimized for performance and can load faster for users.&lt;/li&gt;
&lt;li&gt;Better User Experience: With the decoupling of frontend and backend, the frontend developers can have more control over the design and user experience of the online store, leading to a more seamless and enjoyable experience for the users.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Steps to Build an Online Store with Flotiq Headless CMS
&lt;/h2&gt;

&lt;p&gt;To build an online store with Flotiq headless CMS, you can follow these general steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://editor.flotiq.com/register.html"&gt;Sign up&lt;/a&gt; for an account on Flotiq and create a new project for your online store.&lt;/li&gt;
&lt;li&gt;Define the content models for your online store, such as products, categories, and orders. You can use Flotiq's &lt;a href="https://flotiq.com/starters/"&gt;product starters&lt;/a&gt; and save time by customizing them and not creating them from scratch.&lt;/li&gt;
&lt;li&gt;Add your product data to Flotiq using the content models you have defined. You can do this by manually creating new content or by &lt;a href="https://flotiq.com/docs/CLI/excel-data-migration/#import"&gt;importing data from a CSV file.&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Create a frontend for your online store if you decide to start from zero, or leave it for us, we have Gatbsy and NextJS simple and professional starters.&lt;/li&gt;
&lt;li&gt;Use Flotiq's API to retrieve the product data from the CMS and display it on the frontend of your online store. You can also use the API to handle order and checkout functionality.&lt;/li&gt;
&lt;li&gt;Test your online store and make any necessary adjustments. Once you are satisfied with the final product, launch your online store.
You can use one of our YouTube tutorial with detailed instruction:
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/bMCmirgaI2M"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>webdev</category>
      <category>ecommerce</category>
      <category>lesscode</category>
      <category>headlesscms</category>
    </item>
    <item>
      <title>New update on Flotiq and Gatsby Starters</title>
      <dc:creator>likayeltsova</dc:creator>
      <pubDate>Wed, 04 Jan 2023 11:41:57 +0000</pubDate>
      <link>https://forem.com/flotiq/new-update-on-flotiq-and-gatsby-starters-3fn8</link>
      <guid>https://forem.com/flotiq/new-update-on-flotiq-and-gatsby-starters-3fn8</guid>
      <description>&lt;p&gt;You can use Flotiq to manage and update your content and use Gatsby to build and serve your website or app. This separation of concerns can make managing and maintaining your website or app easier over time. Check our new updated starters to version 5 of Gatbsy.&lt;/p&gt;

&lt;p&gt;Flotiq is a headless content management system that allows developers to easily create, manage, and publish content using a simple and flexible API. Flotiq is designed to be easy to use and integrate with a variety of frameworks and tools, including static site generators like Gatsby. With Flotiq, you can create custom content models and fields and use the Flotiq API to access and manage your content. Flotiq also includes features like version history, user roles and permissions, and integrations with popular tools.&lt;/p&gt;

&lt;p&gt;Gatsby version 5 was released in November 2022, and it includes a number of new features and improvements, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gatsby amplified the speed of Incremental Builds and Incremental Deploys by introducing the Slice API.&lt;/li&gt;
&lt;li&gt;Partial Hydration (Beta)&lt;/li&gt;
&lt;li&gt;Script Component
For more detailed updates you can read &lt;a href="https://www.gatsbyjs.com/blog/gatsby-5/"&gt;on their blog&lt;/a&gt;.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4yUIrozG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fqww2bo011o08wwy74ga.png" alt="Image description" width="880" height="495"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In Flotiq, we provide a number of starter templates and examples that you can use to quickly get started with Gatsby and Flotiq. Here are &lt;a href="https://flotiq.com/starters/"&gt;a few examples&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With the new version of Gatsby, we also updated our starters, so you can enjoy new features and improve your products with Flotiq.&lt;/p&gt;

&lt;p&gt;Our starters include a pre-configured Gatsby project with the:&lt;br&gt;
&lt;code&gt;gatsby-source-flotiq&lt;/code&gt;&lt;br&gt;
plugin installed and configured. You can use all four starters to quickly set up a blog, store, and portfolio website with Gatsby and Flotiq, with support for categories, tags, and featured images. You can find more information and the source code for many starters at our &lt;a href="https://github.com/flotiq"&gt;GitHub profile&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope this information was helpful! If you have any specific questions about using our starters or if you need further assistance, please don't hesitate to ask. We are here to help.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>gatsby</category>
      <category>headlesscms</category>
      <category>lesscode</category>
    </item>
    <item>
      <title>Flotiq Data Migrator</title>
      <dc:creator>likayeltsova</dc:creator>
      <pubDate>Mon, 12 Dec 2022 08:41:01 +0000</pubDate>
      <link>https://forem.com/likayeltsova/flotiq-data-migrator-1je2</link>
      <guid>https://forem.com/likayeltsova/flotiq-data-migrator-1je2</guid>
      <description>&lt;p&gt;&lt;a href="https://discord.com/channels/682699728454025410/987343246189531156/1047910368212684870" rel="noopener noreferrer"&gt;Lately, we have shared&lt;/a&gt; a few of our new Flotiq features that allow you to work more efficiently and improve your products.&lt;br&gt;
Let's talk in more detail about this one. &lt;strong&gt;&lt;a href="https://github.com/flotiq/flotiq-cli/pull/55" rel="noopener noreferrer"&gt;This is a Data migrator from Contentful to Flotiq.&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you have a Contentful account, you could try to use Flotiq without a painless migration. To check how your Contentful data looks like in Flotiq, use the &lt;code&gt;flotiq contenful-import&lt;/code&gt; command&lt;br&gt;
&lt;a href="https://github.com/flotiq/flotiq-cli/pull/55" rel="noopener noreferrer"&gt;https://github.com/flotiq/flotiq-cli/pull/55&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A new feature that allows for data migration from Contentful space to Flotiq.&lt;br&gt;
It imports three types of data: content &lt;em&gt;types, assets and content objects.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The results of migration are displayed in three different tables. Each displays the import's total success and error counts and detailed information about the errors in the Warningsection.&lt;/p&gt;

&lt;p&gt;Flotiq Data migrator allows you to try new headless CMS and check all its benefits.&lt;/p&gt;

&lt;p&gt;Let us know if you have more questions at &lt;a href="mailto:hello@flotiq.com"&gt;hello@flotiq.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Join our discord community - &lt;a href="https://discord.gg/pYC9NPyS" rel="noopener noreferrer"&gt;https://discord.gg/pYC9NPyS&lt;/a&gt;&lt;br&gt;
Leave your feature requests in our roadmap - &lt;a href="https://flotiq.productlift.dev/t/roadmap" rel="noopener noreferrer"&gt;https://flotiq.productlift.dev/t/roadmap&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🌟 Let's simplify content reuse together.&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>Working with Content Objects in Flotiq headless CMS</title>
      <dc:creator>likayeltsova</dc:creator>
      <pubDate>Mon, 14 Nov 2022 15:53:00 +0000</pubDate>
      <link>https://forem.com/flotiq/working-with-content-objects-in-flotiq-headless-cms-185c</link>
      <guid>https://forem.com/flotiq/working-with-content-objects-in-flotiq-headless-cms-185c</guid>
      <description>&lt;h2&gt;
  
  
  Updating content through the API
&lt;/h2&gt;

&lt;p&gt;There are two ways to update the content of an object:&lt;br&gt;
&lt;code&gt;PUT&lt;/code&gt;: When updating the object (&lt;code&gt;PUT&lt;/code&gt; requests), all properties must be present in the request body, as the object data are replaced with the request body. The id property inside the object is ignored in PUT requests. Validation of update request works the same as in saving requests.&lt;br&gt;
&lt;code&gt;PATCH&lt;/code&gt;: When updating an object (a &lt;code&gt;PATCH&lt;/code&gt; request), it is not necessary to specify all the properties of the object. The id property inside the object is ignored in &lt;code&gt;PATCH&lt;/code&gt; requests. Validating the update request works the same as it does when saving requests.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note&lt;br&gt;
You will need to use your &lt;code&gt;Application Read and write API KEY&lt;/code&gt; to perform this action or &lt;code&gt;User API KEY&lt;/code&gt; scoped to accept update on the Content Type you wish to update. Read more about &lt;a href="https://flotiq.com/docs/API/content-type/updating-co/#:~:text=API%20keys%20and%20scoped%20API%20keys"&gt;API keys and scoped API keys.&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Updating Content Objects through the API
&lt;/h2&gt;

&lt;p&gt;For a Content-Type defined according to the &lt;a href="https://flotiq.com/docs/API/content-type/creating-ctd/"&gt;create Content Type example&lt;/a&gt;, a very simple &lt;code&gt;PUT&lt;/code&gt; the payload can be sent to the supporting endpoint &lt;code&gt;https://api.flotiq.com/api/v1/content/{name}/{id}&lt;/code&gt; to update Content Object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  "title": "Object with changed title",
  "postContent": "This will be the new &amp;lt;b&amp;gt;content&amp;lt;/b&amp;gt;"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;name&lt;/code&gt; is the name of the content type definition&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;id&lt;/code&gt; is the ID of the object to update&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example&lt;br&gt;
CURL&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl --location --request PUT 'https://api.flotiq.com/api/v1/content/blogposts/blogposts-456712' \
--header 'X-AUTH-TOKEN: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data-raw '{
    "title": "Object with changed title",
    "postContent": "This will be the new &amp;lt;b&amp;gt;content&amp;lt;/b&amp;gt;"
}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Responses&lt;br&gt;
200 OK&lt;br&gt;
Returned when data has been correct, and the object was saved&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "id": "blogposts-456712",
    "internal": {
        "contentType": "blogposts",
        "createdAt": "2021-04-09T13:30:48+00:00",
        "updatedAt": "2021-04-09T13:30:48+00:00",
        "deletedAt": ""
    },
    "title": "Object with changed title",
    "postContent": "This will be the new &amp;lt;b&amp;gt;content&amp;lt;/b&amp;gt;"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Possible validation errors&lt;/strong&gt;&lt;br&gt;
Possible validation errors are the same as in creating Content Object; you can find the list &lt;a href="https://flotiq.com/docs/API/content-type/creating-co/#possible-validation-errors"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Batch update Content Objects through API
&lt;/h2&gt;

&lt;p&gt;Updating up to 100 objects at once is described &lt;a href="https://flotiq.com/docs/API/content-type/creating-co/#batch-create-content-objects-through-api"&gt;here&lt;/a&gt;, as batch creating and updating are done on the same API endpoint.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>headlesscms</category>
      <category>content</category>
      <category>automation</category>
    </item>
    <item>
      <title>Flotiq GraphQL</title>
      <dc:creator>likayeltsova</dc:creator>
      <pubDate>Wed, 26 Oct 2022 06:11:53 +0000</pubDate>
      <link>https://forem.com/flotiq/flotiq-graphql-3d8o</link>
      <guid>https://forem.com/flotiq/flotiq-graphql-3d8o</guid>
      <description>&lt;p&gt;The Flotiq API supports a GraphQL queries. It is an alternative way to REST API to get your data. We provide the complete, &lt;strong&gt;always up-to-date&lt;/strong&gt; GraphQL description of your data and the endpoint which understands GraphQL queries for your Content Objects.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a GraphQL?
&lt;/h3&gt;

&lt;p&gt;GraphQL is a query language for APIs. It is designed to make API more flexible than REST API - it is all about giving clients precisely the data they request. The developers can pull various data, in the desired shape, with a single API call.&lt;/p&gt;

&lt;h3&gt;
  
  
  Graphql in Flotiq
&lt;/h3&gt;

&lt;p&gt;The system supports GraphQL queries for Content Objects. Endpoints that allow you to interact with the system in a GraphqQL way are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;GET /api/graphql/schema&lt;/code&gt; - get GraphQL schema,&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;POST /api/graphql&lt;/code&gt; - execute GraphQL query.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Authentication
&lt;/h3&gt;

&lt;p&gt;To authenticate the GraphQL query, you need to use one of the Application API Keys available in your &lt;a href="https://flotiq.com/docs/API/"&gt;Flotiq Dashboard&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As in the whole Flotiq API, you can pass your API Key in the following way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;X-AUTH-TOKEN&lt;/code&gt; header&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;auth_token&lt;/code&gt; query parameter&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Note&lt;br&gt;
If you need more information on how to get your API Key and how to use it - go to the &lt;a href="https://flotiq.com/docs/API/"&gt;API access &amp;amp; scoped keys page&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;GraphQL API endpoints are unavailable for the User Defined (scoped) API keys.&lt;/p&gt;

&lt;h3&gt;
  
  
  Get GraphQL Schema
&lt;/h3&gt;

&lt;p&gt;To get the full GraphQL schema that describes your data you have to call the GET endpoint. It describes the shape of your current Content Type Definitions, including attribute types, required fields and relations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Request&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X GET 'https://api.flotiq.com/api/graphql/schema' --header 'X-AUTH-TOKEN: YOUR_API_TOKEN'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Responses&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;200 OK&lt;/p&gt;

&lt;p&gt;Returned when the request was correctly formatted&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type Query {
    category(id: String!): category
    categoryList(page: Int, limit: Int, order_by: String, order_direction: String, filter: String): [category]
    product(id: String!): product
    productList(page: Int, limit: Int, order_by: String, order_direction: String, filter: String): [product]
    _media(id: String!): _media
    _mediaList(page: Int, limit: Int, order_by: String, order_direction: String, filter: String): [_media]
}

"""Auto generated Headless CMS type: _media"""
type _media {
    id: String
    url: String
    size: Float
    type: String
    width: Float
    height: Float
    source: String
    fileName: String
    mimeType: String
    extension: String
    externalId: String
}

"""Auto generated Headless CMS type: category"""
type category {
    id: String
    name: String
    description: String
}

"""Auto generated Headless CMS type: product"""
type product {
    id: String
    name: String
    slug: String
    price: Float
    categories: [category]
    description: String
    productImage: [_media]
    productGallery: [_media]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Execute GraphQL Query
&lt;/h3&gt;

&lt;p&gt;To make a query for your objects, you need to call &lt;code&gt;POST /api/graphql&lt;/code&gt; GraphQL endpoint. We can specify two types of queries - responsible for retrieving a single object and listing objects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Query single object
&lt;/h3&gt;

&lt;p&gt;To a get single object, you need to pass the object identifier and fields you want to receive in the response. Example Query in GraphQL language to get &lt;code&gt;id&lt;/code&gt; and title for the product with id &lt;code&gt;product-1&lt;/code&gt; looks like:&lt;/p&gt;

&lt;p&gt;Graphql&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;query {
    products(id:"product-1") {
        id
        title
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To pass this query to the Flotiq, you need to call:&lt;/p&gt;

&lt;p&gt;Request&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X POST 'https://api.flotiq.com/api/graphql' \
    --header 'X-AUTH-TOKEN: YOUR_API_TOKEN' \
    --header 'Content-Type: application/json' \
    --data-raw '{"query":"query{products(id:\"product-1\"){id,title,}}"}'
Response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;200 OK&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "data": {
        "products": {
            "id": "product-1",
            "title": "Green Tea"
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List objects&lt;br&gt;
While listing objects, you can use the optional parameters &lt;code&gt;page&lt;/code&gt;, &lt;code&gt;limit,&lt;/code&gt;order_by, &lt;code&gt;order_direction,&lt;/code&gt; or &lt;code&gt;filter&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pcHw6iwz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x2adu4yvgfcdwdr275i7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pcHw6iwz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x2adu4yvgfcdwdr275i7.png" alt="Param name and description table" width="847" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Graphql&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;query {
    productsList(limit: 2, order_by: "title", order_direction: "asc") {
        id
        title
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To pass this query to the Flotiq, you need to call:&lt;/p&gt;

&lt;p&gt;Request&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X POST 'https://api.flotiq.com/api/graphql' \
    --header 'X-AUTH-TOKEN: YOUR_API_TOKEN' \
    --header 'Content-Type: application/json' \
    --data-raw '{"query":"query {productsList(limit: 2, order_by: \"title\", order_direction: \"desc\") {id, title}}"}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Response&lt;br&gt;
200 OK&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "data": {
    "productsList": [
      {
        "id": "product-3",
        "title": "Rooibos"
      },
      {
        "id": "product-2",
        "title": "Earl Grey"
      }
    ]
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Relation resolving (hydration)
&lt;/h3&gt;

&lt;p&gt;GraphQLs flexibility also covers object relations (e.g. product has category). In Flotiq, the related objects are resolved automatically based on the type of &lt;code&gt;DataSource&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example, when we have a product object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
   "id":"product-1",
   "categories":[
      {
         "dataUrl":"/api/v1/content/categories/",
         "type":"internal"
      }
   ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and category:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
   "id": "category-1",
   "name": "Tea"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The GraphQL query for listing objects including categories will look like:&lt;/p&gt;

&lt;p&gt;Graphql&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;query {
    productsList(limit: 1) {
        id
        title
        categories {
            id
            name
        }
    }   
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Request&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl --request POST \
    --url 'https://api.flotiq.com/api/graphql?auth_token=__YOUR_AUTH_TOKEN__' \
    --header 'content-type: application/json' \
    --data '{"query":"query{productsList(limit:1){id,title,categories{id,name}}}"}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Response&lt;br&gt;
200 OK&lt;br&gt;
Will return automatically resolved relation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "data": {
        "productsList": [
            {
                "id": "product-3",
                "title": "Rooibos",
                "categories": [
                    {
                        "id": "category-1",
                        "name": "Tea"
                    }
                ]
            }
        ]
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, the related element, &lt;code&gt;category&lt;/code&gt;, was fetched, including its properties.&lt;/p&gt;

&lt;h3&gt;
  
  
  Explore using Insomnia client
&lt;/h3&gt;

&lt;p&gt;GraphQL queries can be complex. To efficiently interact with Flotiq GraphQL API, we suggest you use apps like Insomnia. It helps to create queries with autocomplete, based on your current schema, validate your input and display a preview of the response.&lt;/p&gt;

&lt;p&gt;An example query using &lt;a href="https://insomnia.rest/"&gt;Insomnia REST Client&lt;/a&gt; with endpoint &lt;code&gt;https://api.flotiq.com/api/graphql?auth_token=YOUR_AUTH_TOKEN:&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QohoRA_O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bftg7ux3p89lw8bv1x96.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QohoRA_O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bftg7ux3p89lw8bv1x96.png" alt="Insomnia Flotiq" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>graphql</category>
      <category>headlesscms</category>
      <category>database</category>
    </item>
    <item>
      <title>Flotiq SDK NodeJS</title>
      <dc:creator>likayeltsova</dc:creator>
      <pubDate>Wed, 12 Oct 2022 07:48:48 +0000</pubDate>
      <link>https://forem.com/flotiq/flotiq-sdk-nodejs-11ap</link>
      <guid>https://forem.com/flotiq/flotiq-sdk-nodejs-11ap</guid>
      <description>&lt;h2&gt;
  
  
  SDK NodeJS
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Download a package
&lt;/h3&gt;

&lt;p&gt;On your Flotiq dashboard, you can find link to download client library SDK NodeJS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q5BBC93O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aj8oby75zv8ck8kk3ef0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q5BBC93O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aj8oby75zv8ck8kk3ef0.png" alt="Flotiq Dashboard SDK packages Available frameworks and languages" width="429" height="215"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These package is automatically generated every time you modify your Content Type definitions, just like your API documentation.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Installation
&lt;/h3&gt;

&lt;p&gt;To use SDK in your project follow below steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Unzip and move this package to &lt;code&gt;[projectDirectory]/flotiq-javascript-sdk/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;In your &lt;code&gt;[projectDirectory]/flotiq-javascript-sdk/&lt;/code&gt; run &lt;code&gt;npm i &amp;amp;&amp;amp; npm run build&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;In your &lt;code&gt;[projectDirectory]&lt;/code&gt; run &lt;code&gt;npm i ./flotiq-javascript-sdk --save&lt;/code&gt;
&lt;em&gt;Other installation methods are described in #Additional usage methods section.&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  2. Configure your SDK
&lt;/h3&gt;

&lt;p&gt;To initialize SDK we will use &lt;code&gt;FlotiqUserApi.ApiClient.init&lt;/code&gt; method, which requires to provide the &lt;code&gt;API_KEY&lt;/code&gt; value.&lt;/p&gt;

&lt;p&gt;Your Flotiq API_KEY is located in the &lt;a href="https://editor.flotiq.com/"&gt;Flotiq Dashboard&lt;/a&gt;. If you need more directions go to the &lt;a href="https://flotiq.com/docs/API/"&gt;docs&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const FlotiqUserApi = require("flotiq_user_api");
FlotiqUserApi.ApiClient.init("API_KEY");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Make requests to the Flotiq
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let api = new FlotiqUserApi.ContentBlogAuthorApi();
let opts = {
  page: "1", // {Number} Listing page number, 1-based
  limit: "20", // {Number} Page limit
  orderBy: "internal.updatedAt", // {String} Order by field
  orderDirection: "asc", // {String} Order direction
  hydrate: "0", // {Number} Should hydrate relations of object, for now only one level of hydration is possible
  filters:
    '{"slug":{"type":"contains","filter":"test"},"title":{"type":"contains","filter":"test"}}', // {String} List filters
  ids: '["null"]', // {[String]} Ids of objects to return.
};
api.listFlotiqblogauthor(opts).then(
  function (data) {
    console.log("API called successfully. Returned data: " + data);
  },
  function (error) {
    console.error(error);
  }
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. SDK NodeJS common use cases
&lt;/h3&gt;

&lt;p&gt;The Main concept of Flotiq is that your API Specification represents your set of content definitions literally.&lt;/p&gt;

&lt;p&gt;Can be used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SearchApi: The Flotiq API provides a powerful search engine, which is a wrapper for ElasticSearch queries.&lt;/li&gt;
&lt;li&gt;MediaApi: Endpoint for upload or get media files.&lt;/li&gt;
&lt;li&gt;InternalApi: Returns, delete or create an user-defined Content Definitions&lt;/li&gt;
&lt;li&gt;GraphQlApi: Endpoint for GraphQL Queries for Headless Types&lt;/li&gt;
&lt;li&gt;Content...Api: Endpoints for automatically generated Content Type definitions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VGTiewvA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c16fgnum9q4sznszui3c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VGTiewvA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c16fgnum9q4sznszui3c.png" alt="FlotiqNodeJS" width="880" height="695"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional usage methods
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Local development
&lt;/h3&gt;

&lt;p&gt;You can also use this package as local dependency. To use the library locally without publishing to a remote npm registry or committing to the repository, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm link&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To use the link you just defined in your project, switch to the directory you want to use your flotiq_user_api from, and run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm link /path/to/&amp;lt;JAVASCRIPT_CLIENT_DIR&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Finally, you need to build the module:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm run build&lt;/code&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>headlesscms</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Flotiq Updates</title>
      <dc:creator>likayeltsova</dc:creator>
      <pubDate>Tue, 04 Oct 2022 13:30:04 +0000</pubDate>
      <link>https://forem.com/flotiq/flotiq-updates-eo0</link>
      <guid>https://forem.com/flotiq/flotiq-updates-eo0</guid>
      <description>&lt;p&gt;Over the last few weeks, we have been working on a few updates to the user experience in Flotiq.&lt;/p&gt;

&lt;p&gt;So check what we prepared for you :)&lt;/p&gt;

&lt;h2&gt;
  
  
  User guide onboarding on the dashboard
&lt;/h2&gt;

&lt;p&gt;You can be guided on the Fltoiq dashboard, and in case of any questions, you can always get back to us with the help button on the bottom right corner.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PtWfJPS3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vddcadmayv230d1d5zob.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PtWfJPS3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vddcadmayv230d1d5zob.gif" alt="user guide Flotiq dashboard" width="600" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Media library
&lt;/h2&gt;

&lt;p&gt;We are trying to improve your experience with Flotiq Media Library, so here are some of the updates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Media library - add, edit, remove media tag&lt;/li&gt;
&lt;li&gt;Media library - filter by tag&lt;/li&gt;
&lt;li&gt;Media library - multiple select and delete&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S7sYabuI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qx4sjbyhg9m27ic29303.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S7sYabuI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qx4sjbyhg9m27ic29303.png" alt="Flotiq Media Library" width="880" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An option to buy an extra plan File Quota on the Plan&amp;amp;Usage page&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yjWvWWTi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3mg3p9492u7fyiq75ik.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yjWvWWTi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3mg3p9492u7fyiq75ik.png" alt="Additional space to buy in Flotiq dashboard" width="880" height="501"&gt;&lt;/a&gt;&lt;br&gt;
This is only part of the changes we are working on. Stay tuned to see more updates!&lt;/p&gt;

&lt;p&gt;And let us know what you think at &lt;a href="mailto:hello@flotiq.com"&gt;hello@flotiq.com&lt;/a&gt;&lt;br&gt;
We will be happy to get feedback from you.&lt;br&gt;
✨ Let's simplify content reuse together!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
