Skip to content

Cloudinary image as blur hash

Generating blur hash from Cloudinary images for my covers

Here's how I use Cloudinary to generate a blur hash for a given image.

import {CLOUDINARY_URL} from '@/links';
export async function getBase64Image(imageId: string): Promise<string> {
  const response = await fetch(
  const buffer = await response.arrayBuffer();
  const data = Buffer.from(buffer).toString('base64');
  return `data:image/webp;base64,${data}`;