{"id":28306,"date":"2022-04-22T16:11:20","date_gmt":"2022-04-22T16:11:20","guid":{"rendered":"http:\/\/generate-qr-codes-with-cloudinary"},"modified":"2025-04-16T13:26:45","modified_gmt":"2025-04-16T20:26:45","slug":"generate-qr-codes-with-cloudinary","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/","title":{"rendered":"Generate QR Codes in JavaScript with Cloudinary"},"content":{"rendered":"<div class=\"wp-block-cloudinary-markdown \"><p>URLs are the way of the web, but whether you\u2019re trying to stuff some extra query parameters to control the experience or simply have a long domain name, those URLs can be long to enter manually when you don\u2019t have an easy link to click.<\/p>\n<p>Instead we can take advantage of QR codes by easily generating them programmatically for whatever our need.<\/p>\n<p>Code on GitHub: <a href=\"https:\/\/github.com\/colbyfayock\/cloudinary-qr-generator\">https:\/\/github.com\/colbyfayock\/cloudinary-qr-generator<\/a><\/p>\n<\/div>\n\n<div class=\"wp-block-cloudinary-markdown \"><h2>What do you need to get started?<\/h2>\n<p>For this walkthrough, you\u2019ll need to simply have a Cloudinary account, which you can get for free over at <a href=\"https:\/\/cloudinary.com\/\">cloudinary.com<\/a>.<\/p>\n<p>We\u2019ll also be utilizing the <a href=\"https:\/\/developers.google.com\/chart\/infographics\/docs\/qr_codes?hl=en\">Google Infographics API<\/a>, where the QR Code API is technically deprecated, but we can successfully use it to our advantage for generating QR codes.<\/p>\n<p>We\u2019ll also assume that we\u2019re working in a front end project, such as a React app, where we\u2019ll use a clientside library to generate our image.<\/p>\n<blockquote>\n<p>Note: you can do similar things with serverside Cloudinary libraries as well!<\/p>\n<\/blockquote>\n<h2>Installing &amp; Configuring the Cloudinary URL Gen SDK<\/h2>\n<p>To get started, we need to configure our SDK to use in our project.<\/p>\n<p>We\u2019ll use the <a href=\"https:\/\/cloudinary.com\/documentation\/sdks\/js\/url-gen\/index.html\">Cloudinary URL-Gen for JavaScript SDK<\/a>.<\/p>\n<p>First install the dependencies:<\/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\">yarn<\/span> <span class=\"hljs-selector-tag\">add<\/span> <span class=\"hljs-keyword\">@cloudinary<\/span>\/url-gen \n\n# <span class=\"hljs-keyword\">or<\/span>\n\nnpm install @cloudinary\/url-gen\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>Then import our new package:<\/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> { Cloudinary } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'@cloudinary\/url-gen'<\/span>;\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>Finally we want to set up a new instance that we\u2019ll then use in our project.<\/p>\n<p>Add the following at the top of the file:<\/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> cld = <span class=\"hljs-keyword\">new<\/span> Cloudinary({\n  <span class=\"hljs-attr\">cloud<\/span>: {\n    <span class=\"hljs-attr\">cloudName<\/span>: <span class=\"hljs-string\">'&lt;Your Cloud Name&gt;'<\/span>\n  },\n  <span class=\"hljs-attr\">url<\/span>: {\n    <span class=\"hljs-attr\">forceVersion<\/span>: <span class=\"hljs-literal\">false<\/span>\n  }\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>Make sure to update your <code>cloudName<\/code> value with your own Cloudinary Cloud Name.<\/p>\n<blockquote>\n<p>Tip: you can find your Cloud Name on the Dashboard once logged in.<\/p>\n<\/blockquote>\n<p>You\u2019ll notice we\u2019re also using <code>forceVersion: false<\/code>. We need to add this to avoid Cloudinary attempting to generate our image and store it before it\u2019s actually available, so when using our SDK (which by default adds a version), we\u2019ll simply exclude that version number.<\/p>\n<p>This is mostly important when you need to use a cache-busting mechanism when updating images regularly, which isn\u2019t our case anyways.<\/p>\n<h2>Creating an auto-upload mapping in Cloudinary<\/h2>\n<p>In order to tell Cloudinary where we want it to fetch our QR code image, we need to specify an auto upload mapping.<\/p>\n<p>By using this feature, we can simply specify a folder prefix for our asset and automatically have Cloudinary use our URL prefix when attempting to request a remote image.<\/p>\n<p>In our example, we can use:<\/p>\n<ul>\n<li>Folder: <code>qr<\/code> (or whatever you want)<\/li>\n<li>URL Prefix: <code>[https:\/\/chart.apis.google.com\/chart?cht=qr&amp;chs=500x500&amp;chld=H%7C0&amp;chl=](https:\/\/chart.apis.google.com\/chart?cht=qr&amp;chs=500x500&amp;chld=H%7C0&amp;chl=)<\/code>\n<\/li>\n<\/ul>\n<p>You can find this configuration and add a new mapping under Settings &gt; Upload &gt; Auto upload mapping.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/mediadevs\/image\/upload\/q_auto,f_auto\/c_limit,w_2000\/f_auto\/q_auto\/v1650643360\/e-61d8a704e7f300007004c55b\/jfgnhj2mlnvkcp41o2io.png\" alt=\"QR Auto upload mapping\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"324\"\/><\/p>\n<p>When requesting our URL, such as:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">https:\/\/res.cloudinary.com\/<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Cloud<\/span> <span class=\"hljs-attr\">Name<\/span>&gt;<\/span>\/image\/upload\/<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Folder<\/span>&gt;<\/span>\/<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Remote<\/span> <span class=\"hljs-attr\">Source<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><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>Cloudinary will attempt to fetch our image from:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">https:\/\/chart.apis.google.com\/chart?cht=qr&amp;chs=500x500&amp;chld=H%7C0&amp;chl=<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Remote<\/span> <span class=\"hljs-attr\">Source<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><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>Then deliver it from its CDN, in addition to us now having the ability to do whatever we want with the media asset, such as transformations and effects.<\/p>\n<h2>Generating a Cloudinary URL<\/h2>\n<p>Now we can get to the fun part and generate our image URL with the SDK.<\/p>\n<p>First we want to create our base image:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">const url = cld.image(`<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Mapped<\/span> <span class=\"hljs-attr\">Folder<\/span>&gt;<\/span>\/<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Remote<\/span> <span class=\"hljs-attr\">URL<\/span>&gt;<\/span>`).toURL();\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><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 we\u2019re using the <code>image<\/code> method along with passing in the location of our image to generate a <a href=\"https:\/\/cloudinary.com\/products\/image\">Cloudinary image<\/a> instance, which we then transform to a URL.<\/p>\n<p>We want to change our Mapped Folder value in our invocation to the folder we specified in our auto upload settings. We then want to replace Remote URL value to the location of where we want our QR code to go to.<\/p>\n<p>Now if we try to inspect the value of <code>url<\/code> we\u2019ll see a Cloudinary URL which now returns a QR code image when loaded!<\/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\">https:<span class=\"hljs-comment\">\/\/res.cloudinary.com\/colbycloud-mediajams\/image\/upload\/mediajams\/qr\/https:\/\/spacejelly.dev?_a=ATAK9WI0<\/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><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/colbycloud-mediajams\/image\/upload\/q_auto,f_auto\/c_limit,w_2000\/f_auto\/q_auto\/mediajams\/qr\/https:\/\/spacejelly.dev\" alt=\"QR code that directs to spacejelly.dev\" loading=\"lazy\" class=\"c-transformed-asset\" \/><\/p>\n<h2>Vectorizing &amp; turning a QR code to an SVG file<\/h2>\n<p>One particular benefit of the Cloudinary pipeline is our ability to now use the <a href=\"https:\/\/cloudinary.com\/documentation\/effects_and_artistic_enhancements#vectorize\">vectorize<\/a> effect along with the <a href=\"https:\/\/cloudinary.com\/documentation\/image_transformations#image_format_support\">format<\/a> change feature to turn our new QR code <a href=\"https:\/\/cloudinary.com\/documentation\/effects_and_artistic_enhancements#converting_a_logo_png_to_svg\">into an SVG<\/a>.<\/p>\n<p>To do this, we can now start to chain our effect and transformation to our URL generation.<\/p>\n<p>First, before our <code>toURL()<\/code> method, add:<\/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\">.effect(<span class=\"hljs-string\">'e_vectorize:detail:1.0'<\/span>)\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>We\u2019re using the <code>e_vectorize<\/code> effect as well as providing a configuration to include a high level of detail to make sure we\u2019re getting accurate results.<\/p>\n<p>Then we can turn it into an SVG with:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">.format(<span class=\"hljs-string\">'svg'<\/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\">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>Where our final code should look like:<\/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> url = cld.image(<span class=\"hljs-string\">`&lt;Mapped Folder&gt;\/&lt;Remote URL&gt;`<\/span>).effect(<span class=\"hljs-string\">'e_vectorize:detail:1.0'<\/span>).format(<span class=\"hljs-string\">'svg'<\/span>).toURL();\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>Now if we load our image, we can see that Cloudinary returns an SVG file that gives us the ability to resize it to whatever size we want!<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">https:<span class=\"hljs-comment\">\/\/res.cloudinary.com\/colbycloud-mediajams\/image\/upload\/e_vectorize:detail:1.0\/f_svg\/mediajams\/qr\/https:\/\/spacejelly.dev?_a=ATAK9WI0<\/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\">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><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/colbycloud-mediajams\/image\/upload\/e_vectorize:detail:1.0\/f_svg\/c_limit,w_2000\/f_auto\/q_auto\/mediajams\/qr\/https:\/\/spacejelly.dev\" alt=\"QR code as an SVG file\" loading=\"lazy\" class=\"c-transformed-asset\" \/><\/p>\n<h2>What more can we do?<\/h2>\n<p>Given we now have the ability to do whatever want inside of Cloudinary, we have a wide range of features we can take advantage.<\/p>\n<p>We can use color replacement features to make the QR codes the exact color we want.<\/p>\n<p>Or add image overlays for highly custom QR codes!<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":41,"featured_media":28307,"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,177,246,386,371,373],"class_list":["post-28306","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-guest-post","tag-image","tag-javascript","tag-react","tag-transform","tag-under-review","tag-upload"],"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>Generate QR Codes in JavaScript with Cloudinary<\/title>\n<meta name=\"description\" content=\"Avoid trying to share long URLs in the physical world by programmatically generating QR codes in JavaScript with Cloudinary and the Google Charts API.\" \/>\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\/generate-qr-codes-with-cloudinary\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Generate QR Codes in JavaScript with Cloudinary\" \/>\n<meta property=\"og:description\" content=\"Avoid trying to share long URLs in the physical world by programmatically generating QR codes in JavaScript with Cloudinary and the Google Charts API.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-22T16:11:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-16T20:26:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1681924862\/Web_Assets\/blog\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d-jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"6000\" \/>\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\/generate-qr-codes-with-cloudinary\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Generate QR Codes in JavaScript with Cloudinary\",\"datePublished\":\"2022-04-22T16:11:20+00:00\",\"dateModified\":\"2025-04-16T20:26:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/\"},\"wordCount\":7,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924862\/Web_Assets\/blog\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d.jpg?_i=AA\",\"keywords\":[\"Guest Post\",\"Image\",\"Javascript\",\"React\",\"Transform\",\"Under Review\",\"Upload\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2022\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/\",\"url\":\"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/\",\"name\":\"Generate QR Codes in JavaScript with Cloudinary\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924862\/Web_Assets\/blog\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d.jpg?_i=AA\",\"datePublished\":\"2022-04-22T16:11:20+00:00\",\"dateModified\":\"2025-04-16T20:26:45+00:00\",\"description\":\"Avoid trying to share long URLs in the physical world by programmatically generating QR codes in JavaScript with Cloudinary and the Google Charts API.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924862\/Web_Assets\/blog\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924862\/Web_Assets\/blog\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d.jpg?_i=AA\",\"width\":6000,\"height\":4000},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Generate QR Codes in JavaScript with Cloudinary\"}]},{\"@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":"Generate QR Codes in JavaScript with Cloudinary","description":"Avoid trying to share long URLs in the physical world by programmatically generating QR codes in JavaScript with Cloudinary and the Google Charts API.","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\/generate-qr-codes-with-cloudinary\/","og_locale":"en_US","og_type":"article","og_title":"Generate QR Codes in JavaScript with Cloudinary","og_description":"Avoid trying to share long URLs in the physical world by programmatically generating QR codes in JavaScript with Cloudinary and the Google Charts API.","og_url":"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/","og_site_name":"Cloudinary Blog","article_published_time":"2022-04-22T16:11:20+00:00","article_modified_time":"2025-04-16T20:26:45+00:00","og_image":[{"width":6000,"height":4000,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1681924862\/Web_Assets\/blog\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d-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\/generate-qr-codes-with-cloudinary\/#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/"},"author":{"name":"","@id":""},"headline":"Generate QR Codes in JavaScript with Cloudinary","datePublished":"2022-04-22T16:11:20+00:00","dateModified":"2025-04-16T20:26:45+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/"},"wordCount":7,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924862\/Web_Assets\/blog\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d.jpg?_i=AA","keywords":["Guest Post","Image","Javascript","React","Transform","Under Review","Upload"],"inLanguage":"en-US","copyrightYear":"2022","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/","url":"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/","name":"Generate QR Codes in JavaScript with Cloudinary","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924862\/Web_Assets\/blog\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d.jpg?_i=AA","datePublished":"2022-04-22T16:11:20+00:00","dateModified":"2025-04-16T20:26:45+00:00","description":"Avoid trying to share long URLs in the physical world by programmatically generating QR codes in JavaScript with Cloudinary and the Google Charts API.","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924862\/Web_Assets\/blog\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924862\/Web_Assets\/blog\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d.jpg?_i=AA","width":6000,"height":4000},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/generate-qr-codes-with-cloudinary\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Generate QR Codes in JavaScript with Cloudinary"}]},{"@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\/v1681924862\/Web_Assets\/blog\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d\/32b46168f79fbbc2b706ac003c07015cea03a088-6000x4000-1_283073528d.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/28306","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=28306"}],"version-history":[{"count":2,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/28306\/revisions"}],"predecessor-version":[{"id":37449,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/28306\/revisions\/37449"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/28307"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=28306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=28306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=28306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}