{"id":27898,"date":"2022-03-23T21:57:13","date_gmt":"2022-03-23T21:57:13","guid":{"rendered":"http:\/\/Build-an-avatar-image-generator-with-text-initials-in-Next.js"},"modified":"2025-03-09T13:45:33","modified_gmt":"2025-03-09T20:45:33","slug":"build-an-avatar-image-generator-with-text-initials-in-next-js","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/","title":{"rendered":"Build an Avatar Image Generator"},"content":{"rendered":"<div class=\"wp-block-cloudinary-markdown \"><p>A user\u2019s avatar represents their identity and is one of the most frequently used UI elements. Despite it being a small-sized object, it has enormous power when used in websites and other web applications. Web applications like this that allow personalization enhance the user\u2019s experience and establish a bond between a product and its users.<\/p>\n<p>This article demonstrates how to use <a href=\"https:\/\/cloudinary.com\/\">Cloudinary<\/a> to create a Next.js avatar image generator app.\n<a href=\"https:\/\/nextjs.org\/\">Next.js<\/a> is a React-based framework with functionalities like pre-rendering, both static generation (SSG) and server-side rendering (SSR), automatic code-splitting for faster page loads, and API routes to build API endpoints with serverless functions for back-end features.<\/p>\n<p>Web developers utilize the cloud-based media management tools within Cloudinary to manage media-related assets in web applications. In this tutorial, Cloudinary will be used to store, retrieve, and make numerous image alterations.<\/p>\n<p>\nMoreover, with the increasing demand for personalization, there are several other features that can be integrated into avatar generators. These include:\n<\/p>\n<p>\n<strong>Multiple Font Styles and Colors:<\/strong> Allowing users to choose from a variety of font styles and colors can make the avatar more personalized and in line with the user&#8217;s preferences.\n<\/p>\n<p>\n<strong>Random Color Generation:<\/strong> Instead of sticking to a few predefined colors, providing an option to generate random colors can add an element of surprise and uniqueness to each avatar.\n<\/p>\n<p>\n<strong>Use of Emojis:<\/strong> Emojis are universally recognized and loved. Incorporating them into the avatar can make it more fun and relatable.\n<\/p>\n<p>\n<strong>Background Image Customization: <\/strong>Users can be given the option to choose a background image or an overlay, adding depth and character to the avatar.\n<\/p>\n<p>\n<strong>No Registration Requirement: <\/strong>Making the avatar generator accessible without the need for registration can increase its usability and appeal to a wider audience.\n<\/p>\n<h2>CodeSandbox<\/h2>\n<p>You can fork this <a href=\"https:\/\/codesandbox.io\/s\/avatar-image-generator-nuo35\">Codesandbox<\/a> run the demo or get started quickly.<\/p>\n<\/div>\n\n\n  <div class=\"wp-block-cloudinary-code-sandbox \">\n    <iframe\n      src=\"https:\/\/codesandbox.io\/embed\/avatar-image-generator-nuo35?theme=dark&amp;codemirror=1&amp;highlights=&amp;editorsize=50&amp;fontsize=14&amp;expanddevtools=0&amp;hidedevtools=0&amp;eslint=0&amp;forcerefresh=0&amp;hidenavigation=0&amp;initialpath=%2F&amp;module=&amp;moduleview=0&amp;previewwindow=&amp;view=&amp;runonclick=1\"\n      height=\"500\"\n      style=\"width: 100%;\"\n      title=\"Avatar image generator with Cloudinary\"\n      loading=\"lazy\"\n      allow=\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\"\n      sandbox=\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\"\n    ><\/iframe>\n  <\/div>\n\n\n<div class=\"wp-block-cloudinary-markdown \"><h2>Prerequisites<\/h2>\n<p>To follow the steps in this article, you must have:<\/p>\n<pre><code>- Adequate knowledge of JavaScript and React.js\n- The latest version of Node.js installed\n- A terminal such as ITerm2(Mac OS) or Git bash (Windows)\n- A Cloudinary account - Create one [here](https:\/\/cloudinary.com\/homepage-2).\n<\/code><\/pre>\n<h2>Setting up a Cloudinary account<\/h2>\n<p>After successfully creating an account, Cloudinary will us redirect to our account\u2019s dashboard page, where we can see account details that will be useful later on, including:<\/p>\n<pre><code>- Cloud name\n- API Key\n- API Secret\n<\/code><\/pre>\n<p><strong>NOTE:<\/strong> Do not share these details with anyone.<\/p>\n<h2>Installing the project dependencies<\/h2>\n<p>We create a Next.js app in a new folder called avatar-gen and run the following command in its terminal:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\">    <span class=\"hljs-selector-tag\">npx<\/span> <span class=\"hljs-selector-tag\">create-next-app<\/span> <span class=\"hljs-selector-tag\">avatar-gen<\/span>\n    <span class=\"hljs-selector-tag\">cd<\/span> <span class=\"hljs-selector-tag\">avatar-gen<\/span>\n    <span class=\"hljs-selector-id\">#install<\/span> <span class=\"hljs-selector-tag\">cloudinary<\/span> <span class=\"hljs-selector-tag\">for<\/span> <span class=\"hljs-selector-tag\">React<\/span> <span class=\"hljs-selector-tag\">SDK<\/span> <span class=\"hljs-selector-tag\">and<\/span> <span class=\"hljs-selector-tag\">Lodash<\/span>\n    <span class=\"hljs-selector-tag\">npm<\/span> <span class=\"hljs-selector-tag\">install<\/span> <span class=\"hljs-selector-tag\">cloudinary-react<\/span> <span class=\"hljs-selector-tag\">lodash<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>The code above snippet will install node packages for Next.js, Cloudinary React SDK, and lodash.\nRunning <code>npm run dev<\/code> should render an app with an affirmative message on your browser:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_895A7A23011D4FFE709D4E5015A76D0C6FD581E020614E7B4B9250A1CEBCD8E0_1631618443099_1_-6scLECdebvDGGcKBaAVkw.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1802\" height=\"1260\"\/><\/p>\n<h2>Defining our components<\/h2>\n<p>In development, replace the default code in <code>index.js<\/code> with this:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">    <span class=\"hljs-keyword\">import<\/span> Head <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'next\/head'<\/span>\n    <span class=\"hljs-keyword\">import<\/span> styles <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'..\/styles\/Home.module.css'<\/span>;\n    <span class=\"hljs-keyword\">import<\/span> React, { useState } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"react\"<\/span>;\n    \n    <span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-keyword\">default<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">Home<\/span>(<span class=\"hljs-params\"><\/span>) <\/span>{\n     <span class=\"hljs-keyword\">return<\/span> (\n     <span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">{styles.container}<\/span>&gt;<\/span>\n           <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h1<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">{styles.title}<\/span>&gt;<\/span>\n              Avatar Generator\n            <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h1<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span><\/span>\n      )\n    }\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Next, in <code>index.js<\/code> let\u2019s create a form with two input fields for a user\u2019s First and Last name and assign them to a state variable called <code>formData<\/code>.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">     <span class=\"hljs-keyword\">const<\/span> &#91;formData, setFormData] = useState({\n          <span class=\"hljs-attr\">firstName<\/span>: <span class=\"hljs-string\">''<\/span>,\n          <span class=\"hljs-attr\">lastName<\/span>: <span class=\"hljs-string\">''<\/span>\n        })\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>For the functionality of the input fields, we will declare a new function called <code>handleChange<\/code> for the <code>onChange<\/code> event handler, which detects when the value of an input field changes. The function stores the input\u2019s current value in a state variable.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">    <span class=\"hljs-keyword\">const<\/span> handleSubmit = <span class=\"hljs-function\">(<span class=\"hljs-params\">e<\/span>) =&gt;<\/span> {\n    e.preventDefault();\n        setFormData({\n          <span class=\"hljs-attr\">firstName<\/span> : <span class=\"hljs-string\">''<\/span>,\n          <span class=\"hljs-attr\">lastName<\/span>: <span class=\"hljs-string\">''<\/span>\n        })\n      }\n    }\n    \n    <span class=\"hljs-keyword\">const<\/span> handleChange = <span class=\"hljs-function\">(<span class=\"hljs-params\">e<\/span>) =&gt;<\/span>{\n        setFormData( {...formData, &#91;e.target.name] : e.target.value})\n      }\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>In the code block above, we assigned a function \u2014 <code>handleSubmit<\/code> to the button\u2019s <code>onClick<\/code> handler. The function handles the data that was entered into the form by the user.<\/p>\n<h2>Getting the Avatar initials<\/h2>\n<p>We will define two state variables to store the values whenever the form is submitted and retrieve each value\u2019s initial from both input fields.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">    <span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-keyword\">default<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">Home<\/span>(<span class=\"hljs-params\"><\/span>) <\/span>{\n    <span class=\"hljs-keyword\">const<\/span> &#91;pushedData, setPushedData] = useState()\n    <span class=\"hljs-keyword\">const<\/span> &#91;avatarInitials, setAvatarInitials] = useState({\n        <span class=\"hljs-attr\">firstInitial<\/span>: <span class=\"hljs-string\">''<\/span>,\n        <span class=\"hljs-attr\">secondInitial<\/span>: <span class=\"hljs-string\">''<\/span>\n      }) \n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>We need to add a function that updates the state variables with the values after submitting the form. As a result, we will create a function that retrieves the values\u2019 initials and reset the form.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">    <span class=\"hljs-keyword\">const<\/span> handleSubmit = <span class=\"hljs-function\">(<span class=\"hljs-params\">e<\/span>) =&gt;<\/span> {\n        e.preventDefault();\n        getInitials(formData)\n        setPushedData(formData)\n        setFormData({\n          <span class=\"hljs-attr\">firstName<\/span> : <span class=\"hljs-string\">''<\/span>,\n          <span class=\"hljs-attr\">lastName<\/span>: <span class=\"hljs-string\">''<\/span>\n        })\n      }\n    \n    <span class=\"hljs-keyword\">const<\/span> getInitials = <span class=\"hljs-function\">(<span class=\"hljs-params\">e<\/span>) =&gt;<\/span> {\n        <span class=\"hljs-keyword\">let<\/span> firstName = e.firstName.split(<span class=\"hljs-string\">''<\/span>);\n        <span class=\"hljs-keyword\">let<\/span> lastName = e.lastName.split(<span class=\"hljs-string\">''<\/span>);\n        setAvatarInitials({\n          <span class=\"hljs-attr\">firstInitial<\/span>: firstName&#91;<span class=\"hljs-number\">0<\/span>],\n          <span class=\"hljs-attr\">secondInitial<\/span>: lastName&#91;<span class=\"hljs-number\">0<\/span>]\n        })\n        setText(<span class=\"hljs-literal\">true<\/span>)\n      }\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<h2>Using Cloudinary Transformations<\/h2>\n<p>To access Cloudinary\u2019s SDK(Software Development Kit), we import the required elements of the cloudinary-react library in the <code>index.js<\/code> file.<\/p>\n<p>&lt;!\u2014 Is this import suppose to be for index.js \u2026 perhaps using a comment like this one above code to specify to reader \u2019\/\/ index.js \u2019 \u2014&gt;<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">import<\/span> {Image, Transformation, CloudinaryContext} <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'cloudinary-react'<\/span>;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Then, in the CloudinaryContext component, we apply the Cloud name from our account details on the dashboard page and also include the publicId of the avatar image in the Image component:<\/p>\n<p>&lt;!\u2014 Can you please mention to place code within return() \u2014&gt;<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-keyword\">default<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">Home<\/span>(<span class=\"hljs-params\"><\/span>) <\/span>{\n  <span class=\"hljs-comment\">\/\/ component definitions<\/span>\n\n  <span class=\"hljs-keyword\">return<\/span> (\n    <span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">{styles.container}<\/span>&gt;<\/span>\n      {\/* Head component *\/}\n\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">main<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">{styles.main}<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">form<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">{styles.form}<\/span>&gt;<\/span>\n          <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h1<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">{styles.title}<\/span>&gt;<\/span>Avatar Generator<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h1<\/span>&gt;<\/span>\n          <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">{styles.image}<\/span>&gt;<\/span>\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">CloudinaryContext<\/span> <span class=\"hljs-attr\">cloudName<\/span>=<span class=\"hljs-string\">\"your-public-id\"<\/span>&gt;<\/span>\n              <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Image<\/span> <span class=\"hljs-attr\">publicId<\/span>=<span class=\"hljs-string\">\"sample\"<\/span> <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\">\"profile\"<\/span>&gt;<\/span>\n                \n              <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">Image<\/span>&gt;<\/span>\n            <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">CloudinaryContext<\/span>&gt;<\/span>\n          <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">form<\/span>&gt;<\/span>\n      <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">main<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span><\/span>\n  );\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>You can use the publicId of any image in your Cloudinary account.<\/p>\n<p>Next, we will use the <code>Transformation<\/code> component to convert the image to a blurry circular 150&#215;150 thumbnail with \u201cAB\u201d as its default value.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">CloudinaryContext<\/span> <span class=\"hljs-attr\">cloudName<\/span>=<span class=\"hljs-string\">\"your-cloud-name\"<\/span>&gt;<\/span>\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Image<\/span> <span class=\"hljs-attr\">publicId<\/span>=<span class=\"hljs-string\">\"sample\"<\/span> <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\">\"profile\"<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Transformation<\/span> <span class=\"hljs-attr\">width<\/span>=<span class=\"hljs-string\">\"150\"<\/span> <span class=\"hljs-attr\">height<\/span>=<span class=\"hljs-string\">\"150\"<\/span> <span class=\"hljs-attr\">gravity<\/span>=<span class=\"hljs-string\">\"face\"<\/span> <span class=\"hljs-attr\">effect<\/span>=<span class=\"hljs-string\">\"blur:200\"<\/span> <span class=\"hljs-attr\">radius<\/span>=<span class=\"hljs-string\">\"max\"<\/span> <span class=\"hljs-attr\">crop<\/span>=<span class=\"hljs-string\">\"thumb\"<\/span> \/&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Transformation<\/span> <span class=\"hljs-attr\">background<\/span>=<span class=\"hljs-string\">\"#C5E5FC\"<\/span> \/&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Transformation<\/span> <span class=\"hljs-attr\">overlay<\/span>=<span class=\"hljs-string\">{{fontFamily:<\/span> \"<span class=\"hljs-attr\">Arial<\/span>\", <span class=\"hljs-attr\">fontSize:<\/span> <span class=\"hljs-attr\">50<\/span>, <span class=\"hljs-attr\">fontWeight:<\/span> \"<span class=\"hljs-attr\">bold<\/span>\", <span class=\"hljs-attr\">text:<\/span> \"<span class=\"hljs-attr\">AB<\/span>\"}} <span class=\"hljs-attr\">color<\/span>=<span class=\"hljs-string\">\"white\"<\/span> \/&gt;<\/span>\n      <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">Image<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">CloudinaryContext<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Finally, we create a boolean state variable to display the avatar\u2019s initials and set it to <code>false<\/code>.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">    <span class=\"hljs-keyword\">const<\/span> &#91;text, setText] = useState(<span class=\"hljs-literal\">false<\/span>)\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Then, use a <a href=\"https:\/\/reactjs.org\/docs\/conditional-rendering.html\">ternary conditional rendering<\/a> to replace the default value with data from <code>avatarInitials<\/code> if <code>text<\/code> is <code>true<\/code>; else, it should return \u201cAB\u201d as the default value.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">CloudinaryContext<\/span> <span class=\"hljs-attr\">cloudName<\/span>=<span class=\"hljs-string\">\"your-cloud-name\"<\/span>&gt;<\/span>\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Image<\/span> <span class=\"hljs-attr\">publicId<\/span>=<span class=\"hljs-string\">\"sample\"<\/span> <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\">\"profile\"<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Transformation<\/span> <span class=\"hljs-attr\">width<\/span>=<span class=\"hljs-string\">\"150\"<\/span> <span class=\"hljs-attr\">height<\/span>=<span class=\"hljs-string\">\"150\"<\/span> <span class=\"hljs-attr\">gravity<\/span>=<span class=\"hljs-string\">\"face\"<\/span> <span class=\"hljs-attr\">effect<\/span>=<span class=\"hljs-string\">\"blur:200\"<\/span> <span class=\"hljs-attr\">radius<\/span>=<span class=\"hljs-string\">\"max\"<\/span> <span class=\"hljs-attr\">crop<\/span>=<span class=\"hljs-string\">\"thumb\"<\/span> \/&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Transformation<\/span> <span class=\"hljs-attr\">background<\/span>=<span class=\"hljs-string\">\"#C5E5FC\"<\/span> \/&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Transformation<\/span> <span class=\"hljs-attr\">overlay<\/span>=<span class=\"hljs-string\">{{fontFamily:<\/span> \"<span class=\"hljs-attr\">Arial<\/span>\", <span class=\"hljs-attr\">fontSize:<\/span> <span class=\"hljs-attr\">50<\/span>, <span class=\"hljs-attr\">fontWeight:<\/span> \"<span class=\"hljs-attr\">bold<\/span>\", <span class=\"hljs-attr\">text:<\/span> `${<span class=\"hljs-attr\">text<\/span> ? <span class=\"hljs-attr\">avatarInitials.firstInitial<\/span> <span class=\"hljs-attr\">:<\/span> \"<span class=\"hljs-attr\">A<\/span>\"}${<span class=\"hljs-attr\">text<\/span> ? <span class=\"hljs-attr\">avatarInitials.secondInitial<\/span> <span class=\"hljs-attr\">:<\/span> \"<span class=\"hljs-attr\">B<\/span>\"}`}} <span class=\"hljs-attr\">color<\/span>=<span class=\"hljs-string\">\"white\"<\/span> \/&gt;<\/span>\n      <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">Image<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">CloudinaryContext<\/span>&gt;<\/span>                    \n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Here\u2019s what the page looks like.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_597C622E3E47F82297723C8076045B2BF5532FCDBEFF87AF4EB2A687347E6E2F_1635185920041_avatar+gen+gif.gif\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"748\" height=\"420\"\/><\/p>\n<p>You can right-click on the avatar image and save it if you like.<\/p>\n<p>&lt;!\u2014 Ran into ERROR: loads\/assign , solution: [yarn add lodash] \u2014&gt;<\/p>\n<p>&lt;!\u2014 Ran into ERROR: useState is not defined , solution [import React, { useState } from \u2018react\u2019;\n] in index.js\nCOMMENT-WILLIAM: Fixed all these thanks.\n\u2014&gt;<\/p>\n<h2>Summary<\/h2>\n<p>In this post we built an avatar image generator that takes in two names and makes an avatar image out of it. Try to change the background image of the generated avatar image to one in your Cloudinary account.<\/p>\n<p>Here\u2019s a link to the project repository on <a href=\"https:\/\/github.com\/ugwutotheeshoes\/image-gen\">Github<\/a>.<\/p>\n<h2>Resources<\/h2>\n<ul>\n<li>\n<a href=\"https:\/\/cloudinary.com\/documentation\/image_transformations\">Cloudinary image transformations<\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/uxdesign.cc\/design-avatars-that-make-sense-and-be-more-inclusive-in-the-process-d4dd6a486ea6\">Design better avatars<\/a>\n<\/li>\n<\/ul>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":41,"featured_media":27899,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[134,370,212,246,386,371],"class_list":["post-27898","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-guest-post","tag-image","tag-next-js","tag-react","tag-transform","tag-under-review"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Build an Avatar Image Generator<\/title>\n<meta name=\"description\" content=\"Build an avatar image generator from input text using Cloudinary.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Build an Avatar Image Generator\" \/>\n<meta property=\"og:description\" content=\"Build an avatar image generator from input text using Cloudinary.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-23T21:57:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-09T20:45:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1681925957\/Web_Assets\/blog\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551-jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"4000\" \/>\n\t<meta property=\"og:image:height\" content=\"4000\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Build an Avatar Image Generator\",\"datePublished\":\"2022-03-23T21:57:13+00:00\",\"dateModified\":\"2025-03-09T20:45:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/\"},\"wordCount\":5,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925957\/Web_Assets\/blog\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551.jpg?_i=AA\",\"keywords\":[\"Guest Post\",\"Image\",\"Next.js\",\"React\",\"Transform\",\"Under Review\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2022\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/\",\"url\":\"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/\",\"name\":\"Build an Avatar Image Generator\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925957\/Web_Assets\/blog\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551.jpg?_i=AA\",\"datePublished\":\"2022-03-23T21:57:13+00:00\",\"dateModified\":\"2025-03-09T20:45:33+00:00\",\"description\":\"Build an avatar image generator from input text using Cloudinary.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925957\/Web_Assets\/blog\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925957\/Web_Assets\/blog\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551.jpg?_i=AA\",\"width\":4000,\"height\":4000},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Build an Avatar Image Generator\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Build an Avatar Image Generator","description":"Build an avatar image generator from input text using Cloudinary.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/","og_locale":"en_US","og_type":"article","og_title":"Build an Avatar Image Generator","og_description":"Build an avatar image generator from input text using Cloudinary.","og_url":"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/","og_site_name":"Cloudinary Blog","article_published_time":"2022-03-23T21:57:13+00:00","article_modified_time":"2025-03-09T20:45:33+00:00","og_image":[{"width":4000,"height":4000,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1681925957\/Web_Assets\/blog\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551-jpg?_i=AA","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/"},"author":{"name":"","@id":""},"headline":"Build an Avatar Image Generator","datePublished":"2022-03-23T21:57:13+00:00","dateModified":"2025-03-09T20:45:33+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/"},"wordCount":5,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925957\/Web_Assets\/blog\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551.jpg?_i=AA","keywords":["Guest Post","Image","Next.js","React","Transform","Under Review"],"inLanguage":"en-US","copyrightYear":"2022","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/","url":"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/","name":"Build an Avatar Image Generator","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925957\/Web_Assets\/blog\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551.jpg?_i=AA","datePublished":"2022-03-23T21:57:13+00:00","dateModified":"2025-03-09T20:45:33+00:00","description":"Build an avatar image generator from input text using Cloudinary.","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925957\/Web_Assets\/blog\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925957\/Web_Assets\/blog\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551.jpg?_i=AA","width":4000,"height":4000},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/build-an-avatar-image-generator-with-text-initials-in-next-js\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Build an Avatar Image Generator"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":""}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925957\/Web_Assets\/blog\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551\/e0515eeadb21489399c003444ce55e1ea57bba29-4000x4000-1_27899bd551.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27898","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=27898"}],"version-history":[{"count":3,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27898\/revisions"}],"predecessor-version":[{"id":37192,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27898\/revisions\/37192"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/27899"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=27898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=27898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=27898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}