@zk-email/sdk 0.0.104 → 0.0.105
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/README.md +3 -4
- package/package.json +1 -1
package/README.md
CHANGED
@@ -106,7 +106,7 @@ You can use the sdks' `Gmail` utility class to fetch users emails according to t
|
|
106
106
|
**NOTE:** This will only work if you approved your domain with us.
|
107
107
|
|
108
108
|
```ts
|
109
|
-
import zkeSdk, {
|
109
|
+
import zkeSdk, { Gmail } from "@zk-email/sdk";
|
110
110
|
|
111
111
|
const gmail = new Gmail();
|
112
112
|
const sdk = zkeSdk();
|
@@ -116,11 +116,10 @@ await gmail.authorize();
|
|
116
116
|
|
117
117
|
// Will start Login with Google flow if not already autorized
|
118
118
|
// Fetches emails using the email queries given in the blueprints
|
119
|
-
|
119
|
+
const emails = await gmail.fetchEmails([blueprint]);
|
120
120
|
|
121
121
|
// Will return an empty array if there are no more emails matching the blueprints query
|
122
|
-
|
123
|
-
console.log("moreEmails: ", moreEmails);
|
122
|
+
const moreEmails = await gmail.fetchMore();
|
124
123
|
|
125
124
|
// You can validate if an email is valid according to a blueprint
|
126
125
|
const isValid = await blueprint.validateEmail(emails[0].decodedContents);
|