This package provides a JavaScript SDK for the Quran Foundation Content API and works in both Node.js and the browser.
Full documentation is available at https://api-docs.quran.foundation/sdk.
npm install @quranjs/api
or using pnpm / yarn:
pnpm add @quranjs/api
# or
yarn add @quranjs/api
import { configure, quran } from '@quranjs/api';
configure({
clientId: '<YOUR_QF_CLIENT_ID>',
clientSecret: '<YOUR_QF_CLIENT_SECRET>',
});
const chapters = await quran.qf.chapters.findAll();
console.log(chapters);
For more examples and a complete API reference, see the SDK documentation.
If you used an earlier version of this SDK, please check the migration guide on the documentation site for details on upgrading.