@airxpay/init-sdk 1.0.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tafseel Khan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,268 @@
1
+ # AirXPay Flixora SDK - Seller Onboard
2
+
3
+ <div align="center">
4
+ <img src="./assets/images/flixora.png" alt="AirXPay Flixora SDK" width="100"/>
5
+ </div>
6
+
7
+ **Enterprise-grade TypeScript SDK** for seamless seller onboarding in multi-tenant SaaS platforms. Built with ❤️ by the **Flixora Ecosystem**. Powered by **AirXPay** for payouts and payments, integrated with **TizzyGo**, **TizzyOS**, and soon **TizzyChat** for real-time notifications. Made with a **smiles-first philosophy**, designed to evolve and upgrade continuously for future generations.
8
+
9
+ ---
10
+
11
+ # Our team together build AirXPay with Flixora.
12
+ *We have changed the version of this package airxpay from v1.0.3 to v1.0.5 because it was our compulsion to match the versions of the apps.*
13
+ **I hope you understand. Thanks for your reading.😊❤️**
14
+
15
+ ---
16
+ ## Table of Contents
17
+
18
+ 1. [Overview](#overview)
19
+ 2. [Features](#features)
20
+ 3. [Installation](#installation)
21
+ 4. [Environment Setup](#environment-setup)
22
+ 5. [SDK Initialization](#sdk-initialization)
23
+ 6. [API Methods](#api-methods)
24
+ 7. [Usage Examples](#usage-examples)
25
+ - [React / React Native](#react--react-native)
26
+ - [TypeScript / JavaScript](#typescript--javascript)
27
+ 8. [Folder Structure](#folder-structure)
28
+ 9. [Advanced Usage](#advanced-usage)
29
+ 10. [Error Handling](#error-handling)
30
+ 11. [FAQ](#faq)
31
+ 12. [Support & Contact](#support--contact)
32
+ 13. [License](#license)
33
+
34
+ ---
35
+
36
+ ## 1. Overview
37
+
38
+ The **AirXPay Flixora SDK - Seller Onboard** is a **robust, future-ready SDK** designed to handle seller creation, KYC document uploads, bank account management, and real-time onboarding status tracking.
39
+
40
+ Powered by the **Flixora Ecosystem**:
41
+ - **TizzyGo**: Payment routing & processing
42
+ - **TizzyOS**: Financial OS for SaaS & e-commerce
43
+ - **TizzyChat**: Real-time notifications (coming soon)
44
+
45
+ **Key Principles:**
46
+ - Seamless integration
47
+ - Multi-developer SaaS readiness
48
+ - Future-proof architecture
49
+
50
+ > "Build once, onboard anywhere – from startups to enterprise SaaS."
51
+
52
+ ---
53
+
54
+ ## 2. Features
55
+
56
+ | Feature | Description |
57
+ |---------|-------------|
58
+ | Seller Creation | Create seller profiles with required metadata |
59
+ | KYC Upload | Upload identity documents for verification |
60
+ | Bank Integration | Add and update payout bank accounts |
61
+ | Status Tracking | Poll for pending or completed onboarding |
62
+ | Multi-Tenant Ready | Each developer or tenant isolated via keys |
63
+ | TypeScript First | Full type safety & IntelliSense |
64
+ | React / React Native Support | Native sheets, modal integration |
65
+ | Logging & Retry | Automatic retry, request & response interceptors |
66
+ | Security | Data encryption, key validation, rate limiting |
67
+
68
+ ---
69
+
70
+ ## 3. Installation
71
+
72
+ ### npm
73
+ ```bash
74
+ npm install airxpay
75
+ ````
76
+
77
+ ### yarn
78
+
79
+ ```bash
80
+ yarn add airxpay
81
+ ```
82
+
83
+ ### Peer Dependencies
84
+
85
+ ```bash
86
+ npm install axios
87
+ ```
88
+ ---
89
+
90
+ <div align="center">
91
+ <img src="./assets/images/airxpay.png" alt="airxpay" width="100"/>
92
+ </div>
93
+
94
+ ---
95
+
96
+ ## 4. Environment Setup
97
+
98
+ Create a `.env` file in your project root:
99
+
100
+ ```env
101
+ AIRXPAY_BASE_URL=https://api.airxpay.com
102
+ AIRXPAY_PUBLIC_KEY=your_public_key
103
+ AIRXPAY_SECRET_KEY=your_secret_key
104
+ AIRXPAY_CLIENT_KEY=your_client_key
105
+
106
+ NODE_ENV=development
107
+ APP_NAME=YourApp
108
+ ```
109
+
110
+ Load environment variables using `dotenv` (if Node.js):
111
+
112
+ ```ts
113
+ import dotenv from 'dotenv';
114
+ dotenv.config();
115
+ ```
116
+
117
+ ---
118
+
119
+ ## 5. SDK Initialization
120
+
121
+ ```ts
122
+ import { AirXPay } from 'airxpay';
123
+
124
+ const sdk = new AirXPay({
125
+ baseUrl: process.env.AIRXPAY_BASE_URL!,
126
+ secretKey: process.env.AIRXPAY_SECRET_KEY!,
127
+ clientKey: process.env.AIRXPAY_CLIENT_KEY!
128
+ });
129
+ ```
130
+
131
+ ---
132
+
133
+ ## 6. API Methods
134
+
135
+ | Method | Description |
136
+ | ----------------------------------- | ------------------------------- |
137
+ | `createSeller(seller, keys)` | Create a new seller |
138
+ | `updateKyc(sellerId, docs)` | Upload KYC documents |
139
+ | `updateBank(sellerId, bankDetails)` | Add or update bank info |
140
+ | `getPendingStatus(sellerId)` | Fetch pending onboarding status |
141
+
142
+ ---
143
+
144
+ ## 7. Usage Examples
145
+
146
+ ### React / React Native
147
+
148
+ ```tsx
149
+ import React, { useEffect } from 'react';
150
+ import { AirXPay } from 'airxpay';
151
+
152
+ export const SellerComponent = () => {
153
+ useEffect(() => {
154
+ const sdk = new AirXPay({
155
+ baseUrl: process.env.AIRXPAY_BASE_URL!,
156
+ secretKey: process.env.AIRXPAY_SECRET_KEY!,
157
+ clientKey: process.env.AIRXPAY_CLIENT_KEY!
158
+ });
159
+
160
+ const seller = {
161
+ sellerName: "Jane Doe",
162
+ sellerEmail: "jane@example.com",
163
+ sellerPhone: "+911234567890",
164
+ businessName: "Jane's Store",
165
+ businessType: "Retail",
166
+ country: "IN"
167
+ };
168
+
169
+ const keys = {
170
+ publicKey: process.env.AIRXPAY_PUBLIC_KEY!,
171
+ secretKey: process.env.AIRXPAY_SECRET_KEY!,
172
+ clientKey: process.env.AIRXPAY_CLIENT_KEY!
173
+ };
174
+
175
+ sdk.createSeller(seller, keys).then(console.log).catch(console.error);
176
+ }, []);
177
+
178
+ return <div>Seller onboarding in progress...</div>;
179
+ };
180
+ ```
181
+
182
+ ### TypeScript / JavaScript (Node.js)
183
+
184
+ ```ts
185
+ import { AirXPay } from 'airxpay';
186
+
187
+ const sdk = new AirXPay({
188
+ baseUrl: process.env.AIRXPAY_BASE_URL!,
189
+ secretKey: process.env.AIRXPAY_SECRET_KEY!,
190
+ clientKey: process.env.AIRXPAY_CLIENT_KEY!
191
+ });
192
+
193
+ const sellerData = { /* seller object */ };
194
+ const keys = { /* developer keys */ };
195
+
196
+ sdk.createSeller(sellerData, keys)
197
+ .then(res => console.log(res))
198
+ .catch(err => console.error(err));
199
+ ```
200
+
201
+ ---
202
+
203
+ ## 8. Folder Structure
204
+
205
+ ```
206
+ airxpay/
207
+ ├─ src/
208
+ │ ├─ index.ts
209
+ │ ├─ api/
210
+ │ ├─ config/
211
+ │ ├─ types/
212
+ │ └─ utils/
213
+ ├─ dist/ # Compiled JS
214
+ ├─ package.json
215
+ ├─ tsconfig.json
216
+ └─ README.md
217
+ ```
218
+
219
+ ---
220
+
221
+ ## 9. Advanced Usage
222
+
223
+ * Singleton instance for global SDK
224
+ * Factory pattern for multi-developer support
225
+ * React Native bottom sheet integration
226
+ * Automatic retries and interceptors
227
+ * Logging & custom error handling
228
+
229
+ ---
230
+
231
+ ## 10. Error Handling
232
+
233
+ | Status | Meaning | Recommended Action |
234
+ | ------ | ------------ | ------------------ |
235
+ | 200 | Success | Process normally |
236
+ | 400 | Bad Request | Validate input |
237
+ | 401 | Unauthorized | Refresh keys |
238
+ | 403 | Forbidden | Check permissions |
239
+ | 404 | Not Found | Resource missing |
240
+ | 409 | Conflict | Handle duplicate |
241
+ | 500 | Server Error | Retry request |
242
+
243
+ ---
244
+
245
+ ## 11. FAQ
246
+
247
+ * Can I use this in React Native? ✅ Yes
248
+ * Do I need TypeScript? ❌ Optional, works with JS too
249
+ * Multi-developer support? ✅ Keys are isolated per developer
250
+
251
+ ---
252
+
253
+ ## 12. Support & Contact
254
+
255
+ * Docs: [https://docs.flixora.com/airxpay](https://docs.flixora.com/airxpay)
256
+ * Discord: [https://discord.gg/flixora](https://discord.gg/flixora)
257
+ * Email: [support@flixora.com](mailto:support@flixora.com)
258
+
259
+ ---
260
+
261
+ ## 13. License
262
+
263
+ MIT License © 2026 Flixora Technologies
264
+
265
+ **Your's Simless Smile😊**
266
+ Build with Flixora EcoSystem❤️
267
+
268
+ ---
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AirXPay = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const validateKeys_1 = require("../utils/validateKeys");
9
+ const apiConfig_1 = require("../config/apiConfig");
10
+ class AirXPay {
11
+ constructor(config) {
12
+ this.config = { ...apiConfig_1.defaultConfig, ...config };
13
+ }
14
+ async request(endpoint, data) {
15
+ return axios_1.default.post(`${this.config.baseUrl}${endpoint}`, {
16
+ ...data,
17
+ secretKey: this.config.secretKey,
18
+ clientKey: this.config.clientKey,
19
+ });
20
+ }
21
+ async createSeller(seller, keys) {
22
+ (0, validateKeys_1.validateKeys)(keys);
23
+ const response = await this.request("/create", { ...seller, publicKey: keys.publicKey });
24
+ return response.data;
25
+ }
26
+ async updateKyc(sellerId, docs) {
27
+ const response = await this.request(`/${sellerId}/kyc`, docs);
28
+ return response.data;
29
+ }
30
+ async updateBank(sellerId, bankDetails) {
31
+ const response = await this.request(`/${sellerId}/bank`, bankDetails);
32
+ return response.data;
33
+ }
34
+ async getPendingStatus(sellerId) {
35
+ const response = await axios_1.default.get(`${this.config.baseUrl}/${sellerId}/status`);
36
+ return response.data;
37
+ }
38
+ }
39
+ exports.AirXPay = AirXPay;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defaultConfig = void 0;
4
+ exports.defaultConfig = {
5
+ baseUrl: "http://172.20.10.12:7000/api/seller",
6
+ secretKey: "",
7
+ clientKey: ""
8
+ };
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./api/sellerOnboard"), exports);
18
+ __exportStar(require("./types/sellerTypes"), exports);
19
+ __exportStar(require("./types/developerTypes"), exports);
20
+ __exportStar(require("./utils/validateKeys"), exports);
21
+ __exportStar(require("./utils/uploadHelper"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.base64ToBlob = base64ToBlob;
4
+ function base64ToBlob(base64, type = "image/png") {
5
+ const binary = atob(base64);
6
+ const array = new Uint8Array(binary.length);
7
+ for (let i = 0; i < binary.length; i++) {
8
+ array[i] = binary.charCodeAt(i);
9
+ }
10
+ return new Blob([array], { type });
11
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateKeys = validateKeys;
4
+ function validateKeys(keys) {
5
+ if (!keys.publicKey || !keys.secretKey || !keys.clientKey) {
6
+ throw new Error("publicKey, secretKey, and clientKey are required");
7
+ }
8
+ return true;
9
+ }
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@airxpay/init-sdk",
3
+ "version": "1.0.0",
4
+ "description": "AirXPay Flixora SDK - Seller Onboard",
5
+ "author": "Tafseel Khan",
6
+ "license": "MIT",
7
+
8
+ "main": "dist/index.js",
9
+
10
+ "files": [
11
+ "dist"
12
+ ],
13
+
14
+ "scripts": {
15
+ "build": "tsc --project tsconfig.json --outDir dist --declaration false",
16
+ "prepare": "npm run build"
17
+ },
18
+
19
+ "dependencies": {
20
+ "axios": "^1.13.5"
21
+ },
22
+
23
+ "devDependencies": {
24
+ "typescript": "^5.9.3"
25
+ },
26
+
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/tafseelkhan/airxpay-sdk.git"
30
+ },
31
+
32
+ "keywords": [
33
+ "airxpay",
34
+ "flixora",
35
+ "sdk",
36
+ "seller",
37
+ "onboard"
38
+ ],
39
+
40
+ "bugs": {
41
+ "url": "https://github.com/tafseelkhan/airxpay-sdk/issues"
42
+ },
43
+
44
+ "homepage": "https://github.com/tafseelkhan/airxpay-sdk#readme"
45
+ }