@zindua/sdk 1.2.0 → 1.2.2
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 +39 -3
- package/dist/client.js +1 -1
- package/package.json +2 -10
package/README.md
CHANGED
|
@@ -4,12 +4,48 @@ Official **server-side** SDK for [Zindua](https://zindua.run): one API for trans
|
|
|
4
4
|
|
|
5
5
|
| Resource | Link |
|
|
6
6
|
|----------|------|
|
|
7
|
-
| Website | [zindua.run](https://zindua.run) |
|
|
8
|
-
| Developer documentation | [zindua.run/developers](https://zindua.run/developers) |
|
|
7
|
+
| Website & docs | [zindua.run/developers](https://zindua.run/developers) |
|
|
9
8
|
| HTTP / cURL (no SDK) | [zindua.run/developers#http](https://zindua.run/developers#http) |
|
|
10
|
-
|
|
|
9
|
+
| Pricing & plans | [zindua.run/pricing](https://zindua.run/pricing) |
|
|
11
10
|
| Dashboard | [zindua.run/login](https://zindua.run/login) |
|
|
12
11
|
|
|
12
|
+
Install: `npm install @zindua/sdk`
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Templates and languages
|
|
17
|
+
|
|
18
|
+
Create templates in the **dashboard** (one **slug** per template, e.g. `welcome`, `otp-verification`). Each template can include **email HTML** and **WhatsApp text** for the same slug.
|
|
19
|
+
|
|
20
|
+
Send in a locale with the `lang` field (ISO code: `fr`, `en`, `sw`, …). If you omit `lang`, Zindua uses your project default.
|
|
21
|
+
|
|
22
|
+
| Plan | Templates per project | Languages per template (email + WhatsApp) |
|
|
23
|
+
|------|----------------------|-------------------------------------------|
|
|
24
|
+
| **Free** | 5 | 3 |
|
|
25
|
+
| **Pro** | 50 | 10 |
|
|
26
|
+
| **Team** | 1000 | 100 |
|
|
27
|
+
|
|
28
|
+
On **Free**, the **email API** (`channel: "email"`) is for dashboard/testing; production email via API needs **Pro** or **Team**. **WhatsApp OTP** works on Free (quota applies). See [pricing](https://zindua.run/pricing) for quotas.
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
// French version of the same template slug
|
|
32
|
+
await zindua.send({
|
|
33
|
+
to: "user@example.com",
|
|
34
|
+
template: "welcome",
|
|
35
|
+
lang: "fr",
|
|
36
|
+
variables: { name: "Alex" },
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// WhatsApp: same slug, different channel + E.164 phone
|
|
40
|
+
await zindua.send({
|
|
41
|
+
to: "+243812345678",
|
|
42
|
+
channel: "whatsapp",
|
|
43
|
+
template: "otp-verification",
|
|
44
|
+
lang: "fr",
|
|
45
|
+
variables: { code: "4592", app: "MonApp" },
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
13
49
|
---
|
|
14
50
|
|
|
15
51
|
## Requirements
|
package/dist/client.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Zindua = void 0;
|
|
4
4
|
const errors_1 = require("./errors");
|
|
5
5
|
const validate_1 = require("./validate");
|
|
6
|
-
const SDK_VERSION = "1.2.
|
|
6
|
+
const SDK_VERSION = "1.2.2";
|
|
7
7
|
const USER_AGENT = `Zindua-JS/${SDK_VERSION}`;
|
|
8
8
|
function buildPayload(options, channel) {
|
|
9
9
|
const to = (0, validate_1.validateRecipient)(options.to, channel);
|
package/package.json
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zindua/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Official Zindua SDK for Node.js — transactional email and WhatsApp via POST /api/v1/send.",
|
|
5
|
-
"author": "Zindua
|
|
5
|
+
"author": "Zindua",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://zindua.run/developers#sdks",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/bbasabana/zindua.git",
|
|
11
|
-
"directory": "packages/zindua-js"
|
|
12
|
-
},
|
|
13
|
-
"bugs": {
|
|
14
|
-
"url": "https://github.com/bbasabana/zindua/issues"
|
|
15
|
-
},
|
|
16
8
|
"keywords": [
|
|
17
9
|
"zindua",
|
|
18
10
|
"email",
|