File tree 5 files changed +196
-219
lines changed
5 files changed +196
-219
lines changed Original file line number Diff line number Diff line change 55
55
"@rjsf/core" : " ^5.22.3" ,
56
56
"@rjsf/utils" : " ^5.20.0" ,
57
57
"@rjsf/validator-ajv8" : " ^5.17.1" ,
58
- "@segment/analytics-next" : " ^1.73 .0" ,
58
+ "@segment/analytics-next" : " ^1.77 .0" ,
59
59
"@sentry/react" : " ^8.35.0" ,
60
60
"@tanstack/react-query" : " ^5.59.6" ,
61
61
"@tiptap/react" : " ^2.6.6" ,
Original file line number Diff line number Diff line change @@ -262,6 +262,11 @@ function useSubmitQuestionnaire() {
262
262
} ) ;
263
263
264
264
if ( currentUser && currentOrganization ) {
265
+ const anonymousId = await segment . getAnonymousId ( ) ;
266
+ if ( anonymousId ) {
267
+ segment . alias ( anonymousId , currentUser . _id ) ;
268
+ }
269
+
265
270
segment . identify ( currentUser , {
266
271
organizationType : data . organizationType ,
267
272
jobTitle : data . jobTitle ,
Original file line number Diff line number Diff line change @@ -177,10 +177,8 @@ export const WorkflowsPage = () => {
177
177
navigate ( buildRoute ( ROUTES . WORKFLOWS_CREATE , { environmentSlug : environmentSlug || '' } ) ) ;
178
178
} }
179
179
>
180
- < div className = "flex items-center gap-2" >
181
- < RiFileAddLine />
182
- Blank Workflow
183
- </ div >
180
+ < RiFileAddLine />
181
+ Blank Workflow
184
182
</ div >
185
183
</ DropdownMenuItem >
186
184
< DropdownMenuItem
Original file line number Diff line number Diff line change 1
- import { AnalyticsBrowser } from '@segment/analytics-next' ;
2
- import type { IUserEntity } from '@novu/shared' ;
3
- import * as mixpanel from 'mixpanel-browser' ;
4
1
import { MIXPANEL_KEY , SEGMENT_KEY } from '@/config' ;
2
+ import type { IUserEntity } from '@novu/shared' ;
3
+ import { AnalyticsBrowser } from '@segment/analytics-next' ;
5
4
import * as Sentry from '@sentry/react' ;
5
+ import * as mixpanel from 'mixpanel-browser' ;
6
6
export class SegmentService {
7
7
private _segment : AnalyticsBrowser | null = null ;
8
8
private _segmentEnabled : boolean ;
@@ -146,6 +146,16 @@ export class SegmentService {
146
146
this . _segment ?. reset ( ) ;
147
147
}
148
148
149
+ async getAnonymousId ( ) {
150
+ if ( ! this . isSegmentEnabled ( ) ) {
151
+ return ;
152
+ }
153
+
154
+ const user = await this . _segment ?. user ( ) ;
155
+
156
+ return user ?. anonymousId ( ) ;
157
+ }
158
+
149
159
isSegmentEnabled ( ) : boolean {
150
160
return this . _segmentEnabled && this . _segment !== null && typeof window !== 'undefined' ;
151
161
}
You can’t perform that action at this time.
0 commit comments