8
8
9
9
This is an API for the temporary email service [ TempMail.lol] ( https://tempmail.lol ) .
10
10
11
- ## If you are using a BananaCrumbs ID/Token and have not migrated, install version 3.1.0!! !
11
+ ## If you are using a BananaCrumbs ID/Token and have not migrated, install version 3.1.0 instead of 4.x.x !
12
12
13
13
## Upgrading from 3.1.0
14
14
15
- The only difference between 3.1.0 and 4.0.0 is the fact that the constructor only accepts an API Key, and not a BananaCrumbs ID.
15
+ The key difference between 3.1.0 and 4.0.0 is the fact that the constructor only accepts an API Key, and not a BananaCrumbs ID.
16
+
17
+ The custom domain method has changed as well as the createInbox method's parameters.
16
18
17
19
## Upgrading from 2.0.3
18
20
@@ -36,8 +38,8 @@ First, create a TempMail object:
36
38
``` js
37
39
const tempmail = new TempMail ();
38
40
39
- // if you have a TempMail Plus account, you can add it here:
40
- const tempmail = new TempMail (" 24-number id " , " 32-character token " );
41
+ // if you have a TempMail Plus/Ultra account, you can add it here:
42
+ const tempmail = new TempMail (" API Key " );
41
43
```
42
44
43
45
### Types
@@ -79,18 +81,17 @@ const inbox: Inbox = await tempmail.createInbox();
79
81
// there are some advanced options as well
80
82
81
83
// whether or not to create a community address
82
- const community = true ;
83
- tempmail .createInbox (community );
84
-
84
+ tempmail .createInbox ({
85
+ community: false ,
86
+ domain: " cooldomain.com" ,
87
+ prefix: " optional" ,
88
+ });
85
89
86
- // or to use a specific domain
87
- const domain = " cringemonster.com" ;
88
- tempmail .createInbox (false , domain );
89
90
```
90
91
91
- Note that all inboxes expire after 10 minutes since last check, with a hard expiry limit of one hour that cannot be bypassed.
92
+ Note that all inboxes expire after 30 minutes since last check, with a hard expiry limit of one hour that cannot be bypassed.
92
93
93
- TempMail Plus subscribers can extend this to TEN hours, but the 10 -minute check rule still applies.
94
+ TempMail Plus subscribers can extend this to TEN hours, but the 30 -minute check rule still applies.
94
95
95
96
### Retrieve emails
96
97
@@ -114,18 +115,32 @@ const emails = tempmail.checkInbox("<TOKEN>").then((emails) => {
114
115
115
116
### Custom Domains
116
117
117
- #### Note: you will need to be a TempMail Plus subscriber to use custom domains!
118
+ #### Note: you will need to be a TempMail Plus/Ultra subscriber to use custom domains!
118
119
120
+ #### Old Custom Domains (v1)
119
121
``` js
120
- tempmail .checkCustomDomain (" example.com" , " token" ).then (emails => {
121
- // woohoo, emails!
122
+ tempmail .checkCustomDomainLegacy (" example.com" , " token" ).then (emails => {
123
+ emails .forEach (e => {
124
+ console .log (" Email from: " + e .from + " to " + e .to );
125
+ });
122
126
});
123
127
```
124
128
125
129
You can obtain a token by visiting https://tempmail.lol/custom.html
126
130
127
131
Custom domains will NOT alert you if the token is invalid.
128
132
133
+ #### New Custom Domains (v2)
134
+ ``` js
135
+ tempmail .checkV2CustomDomain (" example.com" ).then (emails => {
136
+ emails .forEach (e => {
137
+ console .log (" Email from: " + e .from + " to " + e .to );
138
+ });
139
+ });
140
+ ```
141
+
142
+ To setup this, visit your account on https://accounts.tempmail.lol and migrate if you have not already.
143
+
129
144
### Webhooks
130
145
131
146
You can set up a webhook to be called when an email is received.
0 commit comments