@zk-email/sdk 2.0.0 → 2.0.1
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 +13 -13
- package/package.json +1 -1
package/README.md
CHANGED
@@ -21,19 +21,19 @@ The SDK includes comprehensive logging capabilities that are **silent by default
|
|
21
21
|
### Basic Usage
|
22
22
|
|
23
23
|
```ts
|
24
|
-
import
|
24
|
+
import { initZkEmailSdk } from "@zk-email/sdk";
|
25
25
|
|
26
26
|
// Silent by default (no logs)
|
27
|
-
const sdk =
|
27
|
+
const sdk = initZkEmailSdk();
|
28
28
|
|
29
29
|
// Enable error-level logging only
|
30
|
-
const sdk =
|
30
|
+
const sdk = initZkEmailSdk({ logging: { enabled: true } });
|
31
31
|
|
32
32
|
// Enable all logs including debug information
|
33
|
-
const sdk =
|
33
|
+
const sdk = initZkEmailSdk({ logging: { level: 'debug', enabled: true } });
|
34
34
|
|
35
35
|
// Completely disable all logging
|
36
|
-
const sdk =
|
36
|
+
const sdk = initZkEmailSdk({ logging: { enabled: false } });
|
37
37
|
```
|
38
38
|
|
39
39
|
### Log Levels
|
@@ -59,16 +59,16 @@ The SDK supports the following log levels in order of verbosity:
|
|
59
59
|
|
60
60
|
```ts
|
61
61
|
// Show only errors (recommended for production)
|
62
|
-
const sdk =
|
62
|
+
const sdk = initZkEmailSdk({ logging: { enabled: true } });
|
63
63
|
|
64
64
|
// Show errors and warnings
|
65
|
-
const sdk =
|
65
|
+
const sdk = initZkEmailSdk({ logging: { level: 'warn', enabled: true } });
|
66
66
|
|
67
67
|
// Show all logs for debugging
|
68
|
-
const sdk =
|
68
|
+
const sdk = initZkEmailSdk({ logging: { level: 'debug', enabled: true } });
|
69
69
|
|
70
70
|
// Completely silent
|
71
|
-
const sdk =
|
71
|
+
const sdk = initZkEmailSdk({ logging: { enabled: false } });
|
72
72
|
```
|
73
73
|
|
74
74
|
## Create a blueprint
|
@@ -81,8 +81,8 @@ we will provide the documentation for this shortly.
|
|
81
81
|
Initialize the SDK:
|
82
82
|
|
83
83
|
```ts
|
84
|
-
import
|
85
|
-
const sdk =
|
84
|
+
import { initZkEmailSdk } from "@zk-email/sdk";
|
85
|
+
const sdk = initZkEmailSdk();
|
86
86
|
```
|
87
87
|
|
88
88
|
Next, obtain the slug of the blueprint you want to create a proof for from our [registry](https://registry.zk.email).
|
@@ -163,10 +163,10 @@ You can use the sdks' `Gmail` utility class to fetch users emails according to t
|
|
163
163
|
**NOTE:** This will only work if you approved your domain with us.
|
164
164
|
|
165
165
|
```ts
|
166
|
-
import
|
166
|
+
import { initZkEmailSdk, Gmail } from "@zk-email/sdk";
|
167
167
|
|
168
168
|
const gmail = new Gmail();
|
169
|
-
const sdk =
|
169
|
+
const sdk = initZkEmailSdk();
|
170
170
|
|
171
171
|
// optional - manually start Login with Google flow and authorize before fetching emails
|
172
172
|
await gmail.authorize();
|