@morambacrypto/connect 0.0.4 → 0.0.5

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.
Files changed (2) hide show
  1. package/README.md +76 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,37 +1,105 @@
1
1
  # Moramba Crypto: Connect
2
2
 
3
- ## Documentation
3
+ A Node.js client library for interacting with the Moramba Crypto API to create and manage JWT tokens for authentication and moramba-crypto feature.
4
4
 
5
- - [API](https://morambacrypto.readme.io/)
5
+ ## Installation
6
6
 
7
+ ```bash
7
8
  npm install @morambacrypto/connect
9
+ ```
10
+
11
+ ## Requirements
12
+
13
+ - Node.js 16+
14
+ - Valid API key and Partner ID
15
+ - Stable internet connection
16
+
17
+ ## Usage
8
18
 
19
+ ### Basic Setup
20
+
21
+ ```javascript
9
22
  import { MorambaClient } from "@morambacrypto/connect";
10
23
 
11
24
  const client = new MorambaClient({
12
25
  baseURL: "https://crypto.moramba.io",
13
26
  apiKey: "YOUR_API_KEY",
14
- partnerId: "YOUR_PARTNER_ID",
27
+ partnerId: "YOUR_PARTNER_ID"
15
28
  });
29
+ ```
30
+
31
+ ### Creating a JWT Token
16
32
 
33
+ ```javascript
17
34
  const response = await client.auth.createJwtToken({
18
35
  userid: "email@example.com",
19
36
  partner_id: "YOUR_PARTNER_ID",
20
- api_key: "YOUR_API_KEY",
37
+ api_key: "YOUR_API_KEY"
21
38
  });
22
39
 
23
40
  console.log("JWT Token:", response.data.token);
24
41
  console.log("Issued At:", response.data.iat);
25
42
  console.log("Expires At:", response.data.exp);
43
+ ```
44
+
45
+ ## API Reference
46
+
47
+ ### MorambaClient
48
+
49
+ The main client class for interacting with the Moramba Crypto API.
50
+
51
+ #### Constructor Options
52
+
53
+ - `baseURL` (string): The base URL for the API (default: "https://crypto.moramba.io")
54
+ - `apiKey` (string): Your API key
55
+ - `partnerId` (string): Your partner ID
56
+
57
+ #### Methods
58
+
59
+ ##### `client.auth.createJwtToken(options)`
60
+
61
+ Creates a JWT token for authentication.
26
62
 
63
+ **Parameters:**
64
+ - `options.userid` (string): User identifier (email)
65
+ - `options.partner_id` (string): Your partner ID
66
+ - `options.api_key` (string): Your API key
27
67
 
28
68
 
29
69
 
30
- 🛠 Requirements
70
+ ## Configuration
71
+
72
+ Make sure to keep your API credentials secure. Consider using environment variables:
73
+
74
+ ```javascript
75
+ const client = new MorambaClient({
76
+ baseURL: "https://crypto.moramba.io",
77
+ apiKey: process.env.MORAMBA_API_KEY,
78
+ partnerId: process.env.MORAMBA_PARTNER_ID
79
+ });
80
+ ```
81
+
82
+ ## Package Information
83
+
84
+ - **Version:** 0.0.4
85
+ - **License:** MIT
86
+ - **Package Size:** 3.56 kB
87
+ - **Total Files:** 18
88
+
89
+
90
+
91
+ ## Support
92
+
93
+ For issues and questions, please visit the [npm package page](https://npmjs.com/package/@morambacrypto/connect).
94
+
95
+ ## Documentation
96
+
97
+ For complete API documentation, visit [API Documentation](https://npmjs.com/package/@morambacrypto/connect).
31
98
 
32
- Node.js 16+
99
+ ## License
33
100
 
34
- Valid api_key and partner_id
101
+ MIT
35
102
 
36
- Stable internet connection
103
+ ---
37
104
 
105
+ Made with ❤️ by Moramba Crypto
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morambacrypto/connect",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "This library use for interact with moramba-crypto project",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",