@@ -37,6 +37,19 @@ createInboxAsync(false).then((inbox) => { //set to true to use Rush Mode domains
37
37
const inbox = await createInboxAsync ();
38
38
```
39
39
40
+ You can also specify a parameter after the rush mode parameter to specify the domain of the inbox. For example:
41
+ ``` js
42
+ createInbox ((inbox , err ) => {
43
+ if (err) {
44
+ return console .error (err);
45
+ }
46
+
47
+ console .log (` Created new inbox: ${ inbox .address } , token: ${ inbox .token } ` );
48
+ }, false , " example.com" );
49
+ ```
50
+
51
+ Will create an inbox with the address ` example.com ` .
52
+
40
53
### Retrieve emails
41
54
42
55
To get the emails (you can also pass in the Inbox object instead of a token string):
@@ -58,3 +71,27 @@ checkInboxAsync("token").then((emails) => {
58
71
// await
59
72
const emails = await checkInboxAsync (" token" );
60
73
```
74
+
75
+ ### Custom Domains
76
+
77
+ Starting September 1st, you can use custom domains with this API. To use a custom domain, you can use the following function:
78
+ ``` js
79
+ // with callback
80
+ checkCustom (" example.com" , " abcdefg..." , (emails ) => {
81
+ emails .forEach ((e ) => {
82
+ console .log (JSON .stringify (e, null , 4 ));
83
+ });
84
+ });
85
+
86
+ // async
87
+ checkCustomAsync (" example.com" , " abcdefg..." ).then ((emails ) => {
88
+ emails .forEach ((e ) => {
89
+ console .log (JSON .stringify (e, null , 4 ));
90
+ });
91
+ });
92
+
93
+ // await
94
+ const emails = await checkCustomAsync (" example.com" , " abcdefg..." );
95
+ ```
96
+
97
+ Custom domains will NOT alert you if the token is invalid.
0 commit comments