File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -75,9 +75,15 @@ export class MermaidChart {
75
75
public async getAuthorizationData ( {
76
76
state,
77
77
scope = [ 'email' ] ,
78
+ trackingParams,
78
79
} : {
79
80
state ?: string ;
80
81
scope ?: string [ ] ;
82
+ trackingParams ?: {
83
+ utm_source : string ;
84
+ utm_medium : string ;
85
+ utm_campaign : string ;
86
+ }
81
87
} = { } ) : Promise < AuthorizationData > {
82
88
if ( ! this . redirectURI ) {
83
89
throw new Error ( 'redirectURI is not set' ) ;
@@ -96,6 +102,13 @@ export class MermaidChart {
96
102
state : stateID ,
97
103
codeVerifier,
98
104
scope,
105
+ ...( trackingParams && {
106
+ extraParams : {
107
+ utm_source : trackingParams . utm_source ,
108
+ utm_medium : trackingParams . utm_medium ,
109
+ utm_campaign : trackingParams . utm_campaign ,
110
+ }
111
+ } ) ,
99
112
} ) ;
100
113
101
114
// Deletes the state after 60 seconds
@@ -253,4 +266,4 @@ export class MermaidChart {
253
266
const raw = await this . axios . get < string > ( URLS . raw ( document , theme ) . svg ) ;
254
267
return raw . data ;
255
268
}
256
- }
269
+ }
You can’t perform that action at this time.
0 commit comments