DEV Community

Bright Agyemang
Bright Agyemang

Posted on

lara-fetch v1.0.3 - now with Drop-in CDN Support

Hey devs,

After weeks of polishing and testing, lara-fetch v1.0.3 is officially stable and production-ready!

Built initially for my own Laravel + Vue/Nuxt stack, it's now open and solid for everyone who wants a smoother fetch experience that just works - both in Node and the browser.


🧠 What is lara-fetch?

A lightweight wrapper around native Fetch that feels familiar to Laravel devs.
Think of it like Axios-simplicity but fully modern, tiny, and framework-agnostic.


What’s New in v1.0.3

  • ✅ Stabilized request/response pipeline
  • ⚡ Unified browser + Node support
  • 🌐 Drop-in CDN build (via UMD) — no bundler needed
  • 📦 Added CommonJS (CJS) support

CDN Usage

<script src="https://cdn.jsdelivr.net/npm/lara-fetch@1.0.3/dist/index.umd.js"></script>

<script>
  laraFetch.configure({
     baseURL: 'https://api.mylaravel.test',
     debug: true
  })

  const res = await laraFetch.post('/users', {
      body: {name: 'Bright', skill: 'fullstack developer'}
  })
  console.log(res.data)
</script>
Enter fullscreen mode Exit fullscreen mode

No need to handle CSRF cookie fetching and header injection. laraFetch does it for you automatically


🧰 NPM Install

npm install lara-fetch
Enter fullscreen mode Exit fullscreen mode

Quick Example

import {laraFetch} from 'lara-fetch'

const res = await laraFetch.post('users', {
  method: 'POST',
  body: {name: 'Bright', skill: 'fullstack developer'},
})

console.log(res.data)

// learn more on the usage from NPM

Enter fullscreen mode Exit fullscreen mode

Why Developers Love It

  • Minimal setup - zero configs
  • Works the same in browser & server
  • Built for Laravel-style APIs
  • Supports ESM, CJS, and UMD (CDN) builds
  • Tiny footprint, modern syntax

⚠️ Limitations:

  • Built strictly for SPAs powered by Laravel API backends.
  • Not SSR-friendly yet - currently working on universal support for server-side environments.

🧩 Docs & Source: https://github.com/agyaboat/lara-fetch
🧵 NPM: https://npmjs.com/package/lara-fetch

Stable. Fast. Simple.
Try it out and drop feedback - I'm actively iterating on community suggestions 💡

Top comments (0)