@elchika-inc/todoke 0.1.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 +21 -0
- package/README.md +64 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/push-cf.d.ts +14 -0
- package/dist/push-cf.d.ts.map +1 -0
- package/dist/push-cf.js +93 -0
- package/dist/push-cf.js.map +1 -0
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 todoke
|
|
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,64 @@
|
|
|
1
|
+
# @elchika-inc/todoke
|
|
2
|
+
|
|
3
|
+
TypeScript SDK for [todoke](https://todoke.dev) — the minimal Web Push notification SaaS with first-class AI (MCP) support.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
> **Note**: `@elchika-inc/todoke` is not yet published to npm. Until it is, build it from this repository:
|
|
8
|
+
>
|
|
9
|
+
> ```bash
|
|
10
|
+
> # after cloning the todoke monorepo
|
|
11
|
+
> bun install
|
|
12
|
+
> cd packages/sdk
|
|
13
|
+
> bun run build # emits dist/ (ESM + type declarations)
|
|
14
|
+
> ```
|
|
15
|
+
|
|
16
|
+
Once published, installation will be:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install @elchika-inc/todoke
|
|
20
|
+
# or: bun add @elchika-inc/todoke / pnpm add @elchika-inc/todoke
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick start
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { PushCF } from "@elchika-inc/todoke";
|
|
27
|
+
|
|
28
|
+
const client = new PushCF({
|
|
29
|
+
apiKey: "pk_your_key",
|
|
30
|
+
// baseUrl: "https://api.todoke.dev" // default
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Subscribe (browser — requires a service worker at /sw.js)
|
|
34
|
+
const registration = await navigator.serviceWorker.ready;
|
|
35
|
+
await client.subscribe({ registration });
|
|
36
|
+
|
|
37
|
+
// Send a notification to all active subscribers
|
|
38
|
+
await client.notify({
|
|
39
|
+
title: "お知らせ",
|
|
40
|
+
body: "新しいメッセージがあります",
|
|
41
|
+
url: "https://yourapp.com/messages",
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// Stats
|
|
45
|
+
const stats = await client.getStats();
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## API key scopes
|
|
49
|
+
|
|
50
|
+
todoke issues API keys with three scopes — use the narrowest one for each surface:
|
|
51
|
+
|
|
52
|
+
| Scope | Use for |
|
|
53
|
+
|---|---|
|
|
54
|
+
| `subscribe_only` | Safe to embed in frontend code (subscribe only) |
|
|
55
|
+
| `notify` | Server-side sending |
|
|
56
|
+
| `full` | Management operations |
|
|
57
|
+
|
|
58
|
+
## Documentation
|
|
59
|
+
|
|
60
|
+
Full guides and API reference: **https://docs.todoke.dev**
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NotifyPayload, PushCFOptions, Stats, SubscribeOptions } from "./types.js";
|
|
2
|
+
export declare class PushCF {
|
|
3
|
+
#private;
|
|
4
|
+
constructor({ apiKey, baseUrl }: PushCFOptions);
|
|
5
|
+
notify(payload: NotifyPayload): Promise<void>;
|
|
6
|
+
subscribe({ registration }: SubscribeOptions): Promise<void>;
|
|
7
|
+
getStats(): Promise<Stats>;
|
|
8
|
+
}
|
|
9
|
+
export declare class PushCFError extends Error {
|
|
10
|
+
readonly status: number;
|
|
11
|
+
readonly code: string;
|
|
12
|
+
constructor(status: number, code: string, message: string);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=push-cf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-cf.d.ts","sourceRoot":"","sources":["../src/push-cf.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAcxF,qBAAa,MAAM;;gBAIL,EAAE,MAAM,EAAE,OAAkC,EAAE,EAAE,aAAa;IAKnE,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAe7C,SAAS,CAAC,EAAE,YAAY,EAAE,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmC5D,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC;CAsBjC;AAED,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAM1D"}
|
package/dist/push-cf.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
function urlBase64ToUint8Array(base64Url) {
|
|
2
|
+
const pad = "=".repeat((4 - (base64Url.length % 4)) % 4);
|
|
3
|
+
const base64 = (base64Url + pad).replace(/-/g, "+").replace(/_/g, "/");
|
|
4
|
+
const raw = atob(base64);
|
|
5
|
+
const buffer = new ArrayBuffer(raw.length);
|
|
6
|
+
const out = new Uint8Array(buffer);
|
|
7
|
+
for (let i = 0; i < raw.length; i++) {
|
|
8
|
+
out[i] = raw.charCodeAt(i);
|
|
9
|
+
}
|
|
10
|
+
return out;
|
|
11
|
+
}
|
|
12
|
+
export class PushCF {
|
|
13
|
+
#apiKey;
|
|
14
|
+
#baseUrl;
|
|
15
|
+
constructor({ apiKey, baseUrl = "https://api.todoke.dev" }) {
|
|
16
|
+
this.#apiKey = apiKey;
|
|
17
|
+
this.#baseUrl = baseUrl.replace(/\/$/, "");
|
|
18
|
+
}
|
|
19
|
+
async notify(payload) {
|
|
20
|
+
const res = await fetch(`${this.#baseUrl}/api/v1/notify`, {
|
|
21
|
+
method: "POST",
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
Authorization: `Bearer ${this.#apiKey}`,
|
|
25
|
+
},
|
|
26
|
+
body: JSON.stringify(payload),
|
|
27
|
+
});
|
|
28
|
+
if (!res.ok) {
|
|
29
|
+
const body = (await res.json().catch(() => ({})));
|
|
30
|
+
throw new PushCFError(res.status, body.code ?? "UNKNOWN", body.error ?? res.statusText);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async subscribe({ registration }) {
|
|
34
|
+
const vapidPublicKey = await this.#fetchVapidPublicKey();
|
|
35
|
+
const subscription = await registration.pushManager.subscribe({
|
|
36
|
+
userVisibleOnly: true,
|
|
37
|
+
applicationServerKey: urlBase64ToUint8Array(vapidPublicKey),
|
|
38
|
+
});
|
|
39
|
+
const json = subscription.toJSON();
|
|
40
|
+
const keys = json.keys;
|
|
41
|
+
if (!json.endpoint || !keys?.p256dh || !keys?.auth) {
|
|
42
|
+
throw new PushCFError(0, "INVALID_SUBSCRIPTION", "PushSubscription is missing required fields");
|
|
43
|
+
}
|
|
44
|
+
const res = await fetch(`${this.#baseUrl}/api/v1/subscriptions`, {
|
|
45
|
+
method: "POST",
|
|
46
|
+
headers: {
|
|
47
|
+
"Content-Type": "application/json",
|
|
48
|
+
Authorization: `Bearer ${this.#apiKey}`,
|
|
49
|
+
},
|
|
50
|
+
body: JSON.stringify({
|
|
51
|
+
endpoint: json.endpoint,
|
|
52
|
+
p256dh: keys.p256dh,
|
|
53
|
+
auth: keys.auth,
|
|
54
|
+
}),
|
|
55
|
+
});
|
|
56
|
+
if (!res.ok) {
|
|
57
|
+
const body = (await res.json().catch(() => ({})));
|
|
58
|
+
throw new PushCFError(res.status, body.code ?? "UNKNOWN", body.error ?? res.statusText);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async getStats() {
|
|
62
|
+
const res = await fetch(`${this.#baseUrl}/api/v1/stats`, {
|
|
63
|
+
headers: { Authorization: `Bearer ${this.#apiKey}` },
|
|
64
|
+
});
|
|
65
|
+
if (!res.ok) {
|
|
66
|
+
const body = (await res.json().catch(() => ({})));
|
|
67
|
+
throw new PushCFError(res.status, body.code ?? "UNKNOWN", body.error ?? res.statusText);
|
|
68
|
+
}
|
|
69
|
+
return res.json();
|
|
70
|
+
}
|
|
71
|
+
async #fetchVapidPublicKey() {
|
|
72
|
+
const res = await fetch(`${this.#baseUrl}/api/v1/vapid-public-key`, {
|
|
73
|
+
headers: { Authorization: `Bearer ${this.#apiKey}` },
|
|
74
|
+
});
|
|
75
|
+
if (!res.ok) {
|
|
76
|
+
const body = (await res.json().catch(() => ({})));
|
|
77
|
+
throw new PushCFError(res.status, body.code ?? "UNKNOWN", body.error ?? res.statusText);
|
|
78
|
+
}
|
|
79
|
+
const { vapidPublicKey } = (await res.json());
|
|
80
|
+
return vapidPublicKey;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export class PushCFError extends Error {
|
|
84
|
+
status;
|
|
85
|
+
code;
|
|
86
|
+
constructor(status, code, message) {
|
|
87
|
+
super(message);
|
|
88
|
+
this.name = "PushCFError";
|
|
89
|
+
this.status = status;
|
|
90
|
+
this.code = code;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=push-cf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-cf.js","sourceRoot":"","sources":["../src/push-cf.ts"],"names":[],"mappings":"AAEA,SAAS,qBAAqB,CAAC,SAAiB;IAC9C,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC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,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAsC,CAAC;YACvF,MAAM,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,IAAI,SAAS,EAAE,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;QAC1F,CAAC;QACD,MAAM,EAAE,cAAc,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAA+B,CAAC;QAC5E,OAAO,cAAc,CAAC;IACxB,CAAC;CACF;AAED,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC3B,MAAM,CAAS;IACf,IAAI,CAAS;IAEtB,YAAY,MAAc,EAAE,IAAY,EAAE,OAAe;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type NotifyPayload = {
|
|
2
|
+
title: string;
|
|
3
|
+
body: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
badge?: string;
|
|
7
|
+
/** Send to a specific endpoint only; omit to broadcast */
|
|
8
|
+
endpoint?: string;
|
|
9
|
+
};
|
|
10
|
+
export type SubscribeOptions = {
|
|
11
|
+
/** Existing ServiceWorkerRegistration to use */
|
|
12
|
+
registration: ServiceWorkerRegistration;
|
|
13
|
+
};
|
|
14
|
+
export type Stats = {
|
|
15
|
+
activeSubscribers: number;
|
|
16
|
+
totalSent: number;
|
|
17
|
+
totalFailed: number;
|
|
18
|
+
totalFailedExpired: number;
|
|
19
|
+
totalFailedOther: number;
|
|
20
|
+
monthlySent: number;
|
|
21
|
+
monthlyFailed: number;
|
|
22
|
+
};
|
|
23
|
+
export type PushCFOptions = {
|
|
24
|
+
apiKey: string;
|
|
25
|
+
/** Defaults to "https://api.todoke.dev" */
|
|
26
|
+
baseUrl?: string;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,gDAAgD;IAChD,YAAY,EAAE,yBAAyB,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elchika-inc/todoke",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "TypeScript SDK for todoke Web Push SaaS",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc -p tsconfig.build.json",
|
|
17
|
+
"typecheck": "tsc --noEmit",
|
|
18
|
+
"test": "vitest run",
|
|
19
|
+
"prepublishOnly": "tsc -p tsconfig.build.json"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"typescript": "^5.7.2",
|
|
23
|
+
"vitest": "^3.1.1"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE"
|
|
29
|
+
],
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://todoke.dev",
|
|
36
|
+
"keywords": [
|
|
37
|
+
"web-push",
|
|
38
|
+
"push-notifications",
|
|
39
|
+
"cloudflare",
|
|
40
|
+
"mcp",
|
|
41
|
+
"todoke"
|
|
42
|
+
]
|
|
43
|
+
}
|