spinupmail 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rıdvan Aktogan
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,80 @@
1
+ # SpinupMail SDK
2
+
3
+ [SpinupMail](https://spinupmail.com) TypeScript SDK for creating and reading temporary email addresses.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm install spinupmail
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ import { SpinupMail } from "spinupmail";
15
+
16
+ const spinupmail = new SpinupMail();
17
+
18
+ const address = await spinupmail.addresses.create({
19
+ acceptedRiskNotice: true,
20
+ });
21
+
22
+ const email = await spinupmail.inboxes.waitForEmail({
23
+ addressId: address.id,
24
+ after: new Date(),
25
+ subjectIncludes: "verify",
26
+ timeoutMs: 30_000,
27
+ });
28
+
29
+ console.log(email.subject);
30
+ ```
31
+
32
+ `new SpinupMail()` defaults to:
33
+
34
+ - `process.env.SPINUPMAIL_API_KEY`
35
+ - `process.env.SPINUPMAIL_BASE_URL` or `https://api.spinupmail.com`
36
+ - `process.env.SPINUPMAIL_ORGANIZATION_ID` or `process.env.SPINUPMAIL_ORG_ID`
37
+
38
+ You can override any of them:
39
+
40
+ ```ts
41
+ import { SpinupMail } from "spinupmail";
42
+
43
+ const spinupmail = new SpinupMail({
44
+ apiKey: "spin_other_key",
45
+ organizationId: "org_123",
46
+ });
47
+ ```
48
+
49
+ If you omit `localPart`, the SDK generates a random valid inbox name before sending the request.
50
+
51
+ Use `search` to match recent emails by indexed content:
52
+
53
+ ```ts
54
+ const email = await spinupmail.inboxes.waitForEmail({
55
+ addressId: address.id,
56
+ search: "verify",
57
+ timeoutMs: 30_000,
58
+ });
59
+
60
+ const emails = await spinupmail.emails.list({
61
+ addressId: address.id,
62
+ search: "verify",
63
+ });
64
+ ```
65
+
66
+ Use `after` with local filters to wait for a specific email after a timestamp:
67
+
68
+ ```ts
69
+ const runStartedAt = new Date();
70
+
71
+ const email = await spinupmail.inboxes.waitForEmail({
72
+ addressId: address.id,
73
+ after: runStartedAt,
74
+ subjectIncludes: "verify",
75
+ bodyIncludes: "654321",
76
+ timeoutMs: 30_000,
77
+ });
78
+
79
+ console.log(email.text);
80
+ ```