Lightweight Client Documentation
Learn how to integrate Lightweight Client into your blog to fetch and display articles
by using our npm package, which works for all frameworks, but implementation is slightly different.
Prerequisites
Before you begin, make sure you have completed the following:
- 1
Create a Lightweight Account
Sign up at lightweight.so to access the portal
- 2
Set Up Your Project
Create a new project in the portal and configure your blog settings
- 3
Generate an API Key
Navigate to → API Keys in your project dashboard to find your unique API key
Note: You can use the demo key 963c9083-8ae0-4db6-af39-7b745890aff4 for testing. Add it to your .env.local file.
Install Lightweight Client
First, install the lightweight-client package in your project.
npm install lightweight-clientChoose Your Framework
Choose your framework to get a detailed implementation guide with full examples.
Next.js
Full-stack React framework with App Router support
React
Build dynamic UIs with hooks and components
Vue
Progressive framework with Composition API
Svelte
Compile-time optimized reactive framework
Add your API key to your environment variables file:
Next.js (.env.local)
LIGHTWEIGHT_API_KEY=your-api-key-hereReact (.env)
REACT_APP_LIGHTWEIGHT_API_KEY=your-api-key-hereVue/Vite (.env)
VITE_LIGHTWEIGHT_API_KEY=your-api-key-here