@minimoth/sdk-node 0.2.0 → 0.2.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 +5 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @minimoth/sdk-node
|
|
2
2
|
|
|
3
|
-
Official Node.js SDK for [MiniMoth](https://minimoth.dev) —
|
|
3
|
+
Official Node.js SDK for [MiniMoth](https://minimoth.dev) — WhatsApp and SMS OTP authentication for Indian developers.
|
|
4
|
+
|
|
5
|
+
📖 **Full documentation:** [minimoth.dev/docs/sdk-nodejs](https://minimoth.dev/docs/sdk-nodejs/)
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
@@ -115,7 +117,7 @@ try {
|
|
|
115
117
|
await client.session.validate(token)
|
|
116
118
|
} catch (err) {
|
|
117
119
|
if (err instanceof MiniMothError) {
|
|
118
|
-
// err.code: '
|
|
120
|
+
// err.code: 'INVALID_ACCESS_TOKEN' | 'SESSION_EXPIRED' | 'NETWORK_ERROR' | ...
|
|
119
121
|
// err.statusCode: HTTP status (0 for network errors)
|
|
120
122
|
res.status(401).json({ error: err.code })
|
|
121
123
|
}
|
|
@@ -191,7 +193,7 @@ Revoke all tokens for a session.
|
|
|
191
193
|
- `accessToken` (string, required): Current access token (will be auto-refreshed if expired)
|
|
192
194
|
- `refreshToken` (string, required): Current refresh token
|
|
193
195
|
- Returns: Promise<void>
|
|
194
|
-
-
|
|
196
|
+
- Throws: `MiniMothError` if the token can't be decoded, the pre-logout refresh fails, or the logout call itself fails. Local session store cleanup errors are caught and logged internally — they don't affect the promise.
|
|
195
197
|
|
|
196
198
|
## Error Codes
|
|
197
199
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minimoth/sdk-node",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Official MiniMoth Node.js SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
19
|
"license": "MIT",
|
|
20
|
-
"homepage": "https://minimoth.dev",
|
|
20
|
+
"homepage": "https://minimoth.dev/docs/sdk-nodejs/",
|
|
21
21
|
"bugs": {
|
|
22
22
|
"email": "dev@minimoth.dev"
|
|
23
23
|
},
|