Skip to content

Commit 9638c80

Browse files
update readme
1 parent be43e85 commit 9638c80

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ createInboxAsync(false).then((inbox) => { //set to true to use Rush Mode domains
3737
const inbox = await createInboxAsync();
3838
```
3939

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+
4053
### Retrieve emails
4154

4255
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) => {
5871
//await
5972
const emails = await checkInboxAsync("token");
6073
```
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

Comments
 (0)