railkit 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -18
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# RailKit
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/railkit)
|
|
4
|
+
[](https://www.npmjs.com/package/railkit)
|
|
5
|
+
[](https://github.com/RAJIV81205/railkit/blob/main/LICENSE)
|
|
6
|
+
|
|
7
|
+
<img width="1536" height="657" alt="RailKit Banner" src="https://github.com/user-attachments/assets/6bdcc05f-186d-4f6f-918d-a99a65026c97" />
|
|
6
8
|
|
|
7
|
-
<img width="1536" height="657" alt="IRCTC Connect Banner" src="https://github.com/user-attachments/assets/39c770a2-639c-443c-93b6-4e78889e78b0" />
|
|
8
9
|
|
|
9
10
|
A comprehensive Node.js SDK for Indian Railways. Get real-time PNR status, train information, live tracking, station updates, train search, and seat availability — all through a single, clean API.
|
|
10
11
|
|
|
@@ -26,14 +27,14 @@ A comprehensive Node.js SDK for Indian Railways. Get real-time PNR status, train
|
|
|
26
27
|
## 📦 Installation
|
|
27
28
|
|
|
28
29
|
```bash
|
|
29
|
-
npm install
|
|
30
|
+
npm install railkit
|
|
30
31
|
```
|
|
31
32
|
|
|
32
33
|
---
|
|
33
34
|
|
|
34
35
|
## 🔑 Getting an API Key
|
|
35
36
|
|
|
36
|
-
1. Visit **[
|
|
37
|
+
1. Visit **[railkit.rajivdubey.dev](https://railkit.rajivdubey.dev)**
|
|
37
38
|
2. Sign up and navigate to your Dashboard
|
|
38
39
|
3. Generate an API key from the **API Keys** section
|
|
39
40
|
4. Copy the key — you'll use it in the next step
|
|
@@ -46,15 +47,15 @@ npm install irctc-connect
|
|
|
46
47
|
|
|
47
48
|
```bash
|
|
48
49
|
# .env
|
|
49
|
-
|
|
50
|
+
RAILKIT_API_KEY=your_api_key_here
|
|
50
51
|
```
|
|
51
52
|
|
|
52
53
|
### Step 2 — Configure the SDK once at startup
|
|
53
54
|
|
|
54
55
|
```javascript
|
|
55
|
-
import { configure } from '
|
|
56
|
+
import { configure } from 'railkit';
|
|
56
57
|
|
|
57
|
-
configure(process.env.
|
|
58
|
+
configure(process.env.RAILKIT_API_KEY);
|
|
58
59
|
```
|
|
59
60
|
|
|
60
61
|
Call `configure()` **once** at the top of your app before using any other function. It stores your key globally for all subsequent calls.
|
|
@@ -71,10 +72,10 @@ import {
|
|
|
71
72
|
searchTrainBetweenStations,
|
|
72
73
|
getAvailability,
|
|
73
74
|
fareLookup,
|
|
74
|
-
} from '
|
|
75
|
+
} from 'railkit';
|
|
75
76
|
|
|
76
77
|
// Configure once
|
|
77
|
-
configure(process.env.
|
|
78
|
+
configure(process.env.RAILKIT_API_KEY);
|
|
78
79
|
|
|
79
80
|
// Check PNR status
|
|
80
81
|
const pnrResult = await checkPNRStatus('1234567890');
|
|
@@ -111,9 +112,9 @@ Configure the SDK with your API key. **Must be called once before any other func
|
|
|
111
112
|
| `apiKey` | string | Your API key from the dashboard |
|
|
112
113
|
|
|
113
114
|
```javascript
|
|
114
|
-
import { configure } from '
|
|
115
|
+
import { configure } from 'railkit';
|
|
115
116
|
|
|
116
|
-
configure(process.env.
|
|
117
|
+
configure(process.env.RAILKIT_API_KEY);
|
|
117
118
|
```
|
|
118
119
|
|
|
119
120
|
---
|
|
@@ -675,7 +676,7 @@ All functions return a consistent response structure. Always check `success` bef
|
|
|
675
676
|
|
|
676
677
|
| Error | Cause |
|
|
677
678
|
|-------|-------|
|
|
678
|
-
| `
|
|
679
|
+
| `railkit is not configured` | `configure()` was not called |
|
|
679
680
|
| `Invalid API key` (401) | Key doesn't exist in the system |
|
|
680
681
|
| `API key is inactive` (403) | Key has been deactivated |
|
|
681
682
|
| `Usage limit exceeded` (429) | Monthly request quota reached |
|
|
@@ -760,15 +761,17 @@ Used by both `getAvailability` and `fareLookup`.
|
|
|
760
761
|
|
|
761
762
|
- Node.js 18+ (native `fetch` required)
|
|
762
763
|
- Internet connection for API calls
|
|
763
|
-
- A valid
|
|
764
|
+
- A valid RailKit API key
|
|
765
|
+
|
|
764
766
|
|
|
765
767
|
---
|
|
766
768
|
|
|
767
769
|
## 🙋 Support
|
|
768
770
|
|
|
769
|
-
- **Issues:** [GitHub Issues](https://github.com/RAJIV81205/
|
|
770
|
-
- **Docs:** [
|
|
771
|
-
- **Discussions:** [GitHub Discussions](https://github.com/RAJIV81205/
|
|
771
|
+
- **Issues:** [GitHub Issues](https://github.com/RAJIV81205/railkit/issues)
|
|
772
|
+
- **Docs:** [railkit.rajivdubey.dev/docs](https://railkit.rajivdubey.dev/docs)
|
|
773
|
+
- **Discussions:** [GitHub Discussions](https://github.com/RAJIV81205/railkit/discussions)
|
|
774
|
+
|
|
772
775
|
|
|
773
776
|
---
|
|
774
777
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "railkit",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "🚂 Complete Node.js SDK for Indian Railways - Check PNR status, train schedules, live running status, seat availability, station information and more. Promise-based API with TypeScript support.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"railkit",
|
|
@@ -49,4 +49,4 @@
|
|
|
49
49
|
"dev": "nodemon index.js",
|
|
50
50
|
"obfuscate": "npx javascript-obfuscator index.js --output index.obfuscated.js --compact true --string-array true --string-array-encoding base64 --rename-globals false --control-flow-flattening false --dead-code-injection false"
|
|
51
51
|
}
|
|
52
|
-
}
|
|
52
|
+
}
|