@@ -17,15 +17,15 @@ Developer-friendly & type-safe Go SDK specifically catered to leverage Novu API.
17
17
<!-- Start Summary [summary] -->
18
18
## Summary
19
19
20
- Novu API: Novu REST API. Please see [ Api reference ] ( https://docs.novu.co/api-reference ) for more details.
20
+ Novu API: Novu REST API. Please see https://docs.novu.co/api-reference for more details.
21
21
22
22
For more information about the API: [ Novu Documentation] ( https://docs.novu.co )
23
23
<!-- End Summary [summary] -->
24
24
25
25
<!-- Start Table of Contents [toc] -->
26
26
## Table of Contents
27
27
<!-- $toc-max-depth=2 -->
28
- * [ github.com/novuhq/novu-go ] ( #githubcomnovuhqnovu-go )
28
+ * [ Novu's API v2 Go SDK ] ( #novus-api-v2-go-sdk )
29
29
* [ SDK Installation] ( #sdk-installation )
30
30
* [ SDK Example Usage] ( #sdk-example-usage )
31
31
* [ Authentication] ( #authentication )
@@ -36,7 +36,6 @@ For more information about the API: [Novu Documentation](https://docs.novu.co)
36
36
* [ Server Selection] ( #server-selection )
37
37
* [ Custom HTTP Client] ( #custom-http-client )
38
38
* [ Development] ( #development )
39
- * [ Maturity] ( #maturity )
40
39
* [ Contributions] ( #contributions )
41
40
42
41
<!-- End Table of Contents [toc] -->
@@ -63,14 +62,13 @@ import (
63
62
novugo " github.com/novuhq/novu-go"
64
63
" github.com/novuhq/novu-go/models/components"
65
64
" log"
66
- " os"
67
65
)
68
66
69
67
func main () {
70
68
ctx := context.Background ()
71
69
72
70
s := novugo.New (
73
- novugo.WithSecurity (os. Getenv ( " NOVU_SECRET_KEY " ) ),
71
+ novugo.WithSecurity (" YOUR_SECRET_KEY_HERE " ),
74
72
)
75
73
76
74
res , err := s.Trigger (ctx, components.TriggerEventRequestDto {
@@ -114,14 +112,13 @@ import (
114
112
novugo " github.com/novuhq/novu-go"
115
113
" github.com/novuhq/novu-go/models/components"
116
114
" log"
117
- " os"
118
115
)
119
116
120
117
func main () {
121
118
ctx := context.Background ()
122
119
123
120
s := novugo.New (
124
- novugo.WithSecurity (os. Getenv ( " NOVU_SECRET_KEY " ) ),
121
+ novugo.WithSecurity (" YOUR_SECRET_KEY_HERE " ),
125
122
)
126
123
127
124
res , err := s.TriggerBulk (ctx, components.BulkTriggerEventDto {
@@ -221,14 +218,13 @@ import (
221
218
novugo " github.com/novuhq/novu-go"
222
219
" github.com/novuhq/novu-go/models/components"
223
220
" log"
224
- " os"
225
221
)
226
222
227
223
func main () {
228
224
ctx := context.Background ()
229
225
230
226
s := novugo.New (
231
- novugo.WithSecurity (os. Getenv ( " NOVU_SECRET_KEY " ) ),
227
+ novugo.WithSecurity (" YOUR_SECRET_KEY_HERE " ),
232
228
)
233
229
234
230
res , err := s.TriggerBroadcast (ctx, components.TriggerEventToAllRequestDto {
@@ -259,14 +255,13 @@ import (
259
255
" context"
260
256
novugo " github.com/novuhq/novu-go"
261
257
" log"
262
- " os"
263
258
)
264
259
265
260
func main () {
266
261
ctx := context.Background ()
267
262
268
263
s := novugo.New (
269
- novugo.WithSecurity (os. Getenv ( " NOVU_SECRET_KEY " ) ),
264
+ novugo.WithSecurity (" YOUR_SECRET_KEY_HERE " ),
270
265
)
271
266
272
267
res , err := s.Cancel (ctx, " <id>" , nil )
@@ -301,14 +296,13 @@ import (
301
296
novugo " github.com/novuhq/novu-go"
302
297
" github.com/novuhq/novu-go/models/components"
303
298
" log"
304
- " os"
305
299
)
306
300
307
301
func main () {
308
302
ctx := context.Background ()
309
303
310
304
s := novugo.New (
311
- novugo.WithSecurity (os. Getenv ( " NOVU_SECRET_KEY " ) ),
305
+ novugo.WithSecurity (" YOUR_SECRET_KEY_HERE " ),
312
306
)
313
307
314
308
res , err := s.Trigger (ctx, components.TriggerEventRequestDto {
@@ -388,12 +382,9 @@ func main() {
388
382
### [ Subscribers] ( docs/sdks/subscribers/README.md )
389
383
390
384
* [ List] ( docs/sdks/subscribers/README.md#list ) - Get subscribers
391
- * [ Create] ( docs/sdks/subscribers/README.md#create ) - Create subscriber
392
- * [ RetrieveLegacy] ( docs/sdks/subscribers/README.md#retrievelegacy ) - Get subscriber
393
- * [ UpdateLegacy] ( docs/sdks/subscribers/README.md#updatelegacy ) - Update subscriber
394
- * [ ~~ DeleteLegacy~~ ] ( docs/sdks/subscribers/README.md#deletelegacy ) - Delete subscriber :warning : ** Deprecated**
395
385
* [ CreateBulk] ( docs/sdks/subscribers/README.md#createbulk ) - Bulk create subscribers
396
386
* [ Search] ( docs/sdks/subscribers/README.md#search ) - Search for subscribers
387
+ * [ Create] ( docs/sdks/subscribers/README.md#create ) - Create subscriber
397
388
* [ Retrieve] ( docs/sdks/subscribers/README.md#retrieve ) - Get subscriber
398
389
* [ Patch] ( docs/sdks/subscribers/README.md#patch ) - Patch subscriber
399
390
* [ Delete] ( docs/sdks/subscribers/README.md#delete ) - Delete subscriber
@@ -422,16 +413,9 @@ func main() {
422
413
423
414
#### [ Subscribers.Preferences] ( docs/sdks/preferences/README.md )
424
415
425
- * [ ~~ ListLegacy~~ ] ( docs/sdks/preferences/README.md#listlegacy ) - Get subscriber preferences :warning : ** Deprecated**
426
- * [ ~~ RetrieveByLevelLegacy~~ ] ( docs/sdks/preferences/README.md#retrievebylevellegacy ) - Get subscriber preferences by level :warning : ** Deprecated**
427
- * [ UpdateLegacy] ( docs/sdks/preferences/README.md#updatelegacy ) - Update subscriber preference
428
- * [ Retrieve] ( docs/sdks/preferences/README.md#retrieve ) - Get subscriber preferences
416
+ * [ List] ( docs/sdks/preferences/README.md#list ) - Get subscriber preferences
429
417
* [ Update] ( docs/sdks/preferences/README.md#update ) - Update subscriber global or workflow specific preferences
430
418
431
- #### [ Subscribers.Preferences.Legacy] ( docs/sdks/legacy/README.md )
432
-
433
- * [ UpdateGlobal] ( docs/sdks/legacy/README.md#updateglobal ) - Update subscriber global preferences
434
-
435
419
#### [ Subscribers.Properties] ( docs/sdks/properties/README.md )
436
420
437
421
* [ UpdateOnlineFlag] ( docs/sdks/properties/README.md#updateonlineflag ) - Update subscriber online status
@@ -468,14 +452,13 @@ import (
468
452
" context"
469
453
novugo " github.com/novuhq/novu-go"
470
454
" log"
471
- " os"
472
455
)
473
456
474
457
func main () {
475
458
ctx := context.Background ()
476
459
477
460
s := novugo.New (
478
- novugo.WithSecurity (os. Getenv ( " NOVU_SECRET_KEY " ) ),
461
+ novugo.WithSecurity (" YOUR_SECRET_KEY_HERE " ),
479
462
)
480
463
481
464
res , err := s.Subscribers .List (ctx, nil , nil , nil )
@@ -518,14 +501,13 @@ import (
518
501
" github.com/novuhq/novu-go/retry"
519
502
" log"
520
503
" models/operations"
521
- " os"
522
504
)
523
505
524
506
func main () {
525
507
ctx := context.Background ()
526
508
527
509
s := novugo.New (
528
- novugo.WithSecurity (os. Getenv ( " NOVU_SECRET_KEY " ) ),
510
+ novugo.WithSecurity (" YOUR_SECRET_KEY_HERE " ),
529
511
)
530
512
531
513
res , err := s.Trigger (ctx, components.TriggerEventRequestDto {
@@ -579,7 +561,6 @@ import (
579
561
" github.com/novuhq/novu-go/models/components"
580
562
" github.com/novuhq/novu-go/retry"
581
563
" log"
582
- " os"
583
564
)
584
565
585
566
func main () {
@@ -597,7 +578,7 @@ func main() {
597
578
},
598
579
RetryConnectionErrors: false ,
599
580
}),
600
- novugo.WithSecurity (os. Getenv ( " NOVU_SECRET_KEY " ) ),
581
+ novugo.WithSecurity (" YOUR_SECRET_KEY_HERE " ),
601
582
)
602
583
603
584
res , err := s.Trigger (ctx, components.TriggerEventRequestDto {
@@ -661,14 +642,13 @@ import (
661
642
" github.com/novuhq/novu-go/models/apierrors"
662
643
" github.com/novuhq/novu-go/models/components"
663
644
" log"
664
- " os"
665
645
)
666
646
667
647
func main () {
668
648
ctx := context.Background ()
669
649
670
650
s := novugo.New (
671
- novugo.WithSecurity (os. Getenv ( " NOVU_SECRET_KEY " ) ),
651
+ novugo.WithSecurity (" YOUR_SECRET_KEY_HERE " ),
672
652
)
673
653
674
654
res , err := s.Trigger (ctx, components.TriggerEventRequestDto {
@@ -736,10 +716,10 @@ func main() {
736
716
737
717
You can override the default server globally using the ` WithServerIndex(serverIndex int) ` option when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
738
718
739
- | # | Server |
740
- | --- | ------------------------ |
741
- | 0 | ` https://api.novu.co ` |
742
- | 1 | ` https://eu.api.novu.co ` |
719
+ | # | Server | Description |
720
+ | --- | ------------------------ | ----------- |
721
+ | 0 | ` https://api.novu.co ` | |
722
+ | 1 | ` https://eu.api.novu.co ` | |
743
723
744
724
#### Example
745
725
@@ -751,15 +731,14 @@ import (
751
731
novugo " github.com/novuhq/novu-go"
752
732
" github.com/novuhq/novu-go/models/components"
753
733
" log"
754
- " os"
755
734
)
756
735
757
736
func main () {
758
737
ctx := context.Background ()
759
738
760
739
s := novugo.New (
761
740
novugo.WithServerIndex (1 ),
762
- novugo.WithSecurity (os. Getenv ( " NOVU_SECRET_KEY " ) ),
741
+ novugo.WithSecurity (" YOUR_SECRET_KEY_HERE " ),
763
742
)
764
743
765
744
res , err := s.Trigger (ctx, components.TriggerEventRequestDto {
@@ -804,15 +783,14 @@ import (
804
783
novugo " github.com/novuhq/novu-go"
805
784
" github.com/novuhq/novu-go/models/components"
806
785
" log"
807
- " os"
808
786
)
809
787
810
788
func main () {
811
789
ctx := context.Background ()
812
790
813
791
s := novugo.New (
814
792
novugo.WithServerURL (" https://api.novu.co" ),
815
- novugo.WithSecurity (os. Getenv ( " NOVU_SECRET_KEY " ) ),
793
+ novugo.WithSecurity (" YOUR_SECRET_KEY_HERE " ),
816
794
)
817
795
818
796
res , err := s.Trigger (ctx, components.TriggerEventRequestDto {
0 commit comments