Skip to content

Commit b3a2b27

Browse files
authored
Fix SDKs path (#59)
1 parent 18d85aa commit b3a2b27

16 files changed

Lines changed: 964 additions & 758 deletions

‎docs/sdk/audio.mdx‎

Lines changed: 0 additions & 99 deletions
This file was deleted.

‎docs/sdk/chapters.mdx‎

Lines changed: 0 additions & 78 deletions
This file was deleted.

‎docs/sdk/index.mdx‎

Lines changed: 22 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,37 @@
11
---
2-
title: Getting Started
3-
description: Install and configure @quranjs/api - a TypeScript SDK for the Quran.com API.
2+
title: SDKs
3+
description: Official SDKs for the Quran.Foundation API.
44
slug: /sdk
55
---
66

7-
import Tabs from '@theme/Tabs';
8-
import TabItem from '@theme/TabItem';
7+
# Official SDKs
98

10-
## Installation
9+
We provide official SDKs to help you integrate the Quran.Foundation API into your applications quickly and easily.
1110

12-
<Tabs groupId="sdk-install" queryString>
13-
<TabItem value="npm" label="npm">
11+
## Available SDKs
1412

15-
```bash
16-
npm install @quranjs/api
17-
```
13+
| Language | Package | Status |
14+
| --------------------------- | -------------------------------------- | ------------ |
15+
| **JavaScript / TypeScript** | [`@quranjs/api`](/docs/sdk/javascript) | ✅ Available |
16+
| Python | Coming soon | 🚧 Planned |
17+
| Swift | Coming soon | 🚧 Planned |
18+
| Kotlin | Coming soon | 🚧 Planned |
1819

19-
</TabItem>
20-
<TabItem value="pnpm" label="pnpm">
20+
## Get Started
2121

22-
```bash
23-
pnpm install @quranjs/api
24-
```
22+
Choose your language to get started:
2523

26-
</TabItem>
27-
<TabItem value="yarn" label="yarn">
24+
- [JavaScript / TypeScript SDK](/docs/sdk/javascript) — Full-featured SDK for Node.js and browsers
2825

29-
```bash
30-
yarn add @quranjs/api
31-
```
26+
## Why Use an SDK?
3227

33-
</TabItem>
34-
<TabItem value="bun" label="bun">
28+
Our SDKs provide:
3529

36-
```bash
37-
bun add @quranjs/api
38-
```
30+
- **Type Safety** — Full TypeScript support with comprehensive type definitions
31+
- **Authentication** — Automatic OAuth2 token management and refresh
32+
- **Error Handling** — Consistent error handling across all endpoints
33+
- **Developer Experience** — IntelliSense support and comprehensive documentation
3934

40-
</TabItem>
41-
</Tabs>
35+
## Direct API Access
4236

43-
## Quick Start
44-
45-
```ts
46-
import { Language, QuranClient } from "@quranjs/api";
47-
48-
// Initialize the client
49-
const client = new QuranClient({
50-
clientId: process.env.QURAN_CLIENT_ID!,
51-
clientSecret: process.env.QURAN_CLIENT_SECRET!,
52-
defaults: {
53-
language: Language.ENGLISH,
54-
},
55-
});
56-
57-
// Fetch all chapters
58-
const chapters = await client.chapters.findAll();
59-
60-
// Get a specific verse
61-
const verse = await client.verses.findByKey("2:255", {
62-
translations: [20],
63-
words: true,
64-
});
65-
66-
// Search
67-
const results = await client.search.search("light", {
68-
language: Language.ENGLISH,
69-
size: 10,
70-
});
71-
```
72-
73-
## Environment Variables
74-
75-
```bash
76-
# .env
77-
QURAN_CLIENT_ID=your_client_id
78-
QURAN_CLIENT_SECRET=your_client_secret
79-
```
80-
81-
```ts
82-
const client = new QuranClient({
83-
clientId: process.env.QURAN_CLIENT_ID!,
84-
clientSecret: process.env.QURAN_CLIENT_SECRET!,
85-
});
86-
```
87-
88-
## Runtime Configuration
89-
90-
```ts
91-
// Get current config
92-
const config = client.getConfig();
93-
94-
// Update config
95-
client.updateConfig({
96-
defaults: { language: Language.ARABIC },
97-
});
98-
99-
// Clear auth token
100-
client.clearCachedToken();
101-
```
102-
103-
## Next Steps
104-
105-
- [Chapters API](/docs/sdk/chapters)
106-
- [Verses API](/docs/sdk/verses)
107-
- [Audio API](/docs/sdk/audio)
108-
- [Resources API](/docs/sdk/resources)
109-
- [Migration Guide](/docs/sdk/migration)
37+
If you prefer to use the API directly without an SDK, check out our [Quick Start Guide](/docs/quickstart) and [API Reference](/docs/category/content-apis).

0 commit comments

Comments
 (0)