Back to Home
Local and Self-Hosted Examples

Integration Examples

Use these examples when you run the project locally or deploy your own copy. The official hosted domain keeps the API private for now.

Clone the repository

Run the full API locally with `npm run dev`.

Install the SDK

Point the client at your local or hosted base URL.

Surah List Demo

GET /api/surahs

Fetching first 10 surahs from your current deployment...

Code Example (Next.js)

const API_BASE_URL = process.env.NEXT_PUBLIC_QURAN_API_BASE_URL ?? 'http://localhost:3000';

async function getSurahs() {
  const res = await fetch(`${API_BASE_URL}/api/v1/surahs`);
  const data = await res.json();
  
  if (data.success) {
    return data.data;
  }
  return [];
}