-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
708 additions
and
851 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export const getUserData = async () => { | ||
const user = figma.currentUser; | ||
if (user) { | ||
figma.ui.postMessage({ | ||
type: 'USER_DATA', | ||
data: { | ||
userId: user.id, | ||
name: user.name | ||
} | ||
}); | ||
} else { | ||
console.error('Could not get user data'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
VITE_SENTRY_DSN= | ||
VITE_MIXPANEL_TOKEN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import mixpanel from 'mixpanel-figma'; | ||
|
||
export const track = (name: string, opts = {}) => { | ||
if (import.meta.env.VITE_MIXPANEL_TOKEN) { | ||
mixpanel.track(name, opts); | ||
} | ||
}; | ||
|
||
export const identify = ({ userId, name }: { userId: string; name: string }) => { | ||
if (import.meta.env.VITE_MIXPANEL_TOKEN) { | ||
mixpanel.identify(userId); | ||
|
||
mixpanel.people.set({ | ||
USER_ID: userId, | ||
$name: name, | ||
version: APP_VERSION | ||
}); | ||
} | ||
}; | ||
|
||
export const initializeMixpanel = () => { | ||
if (import.meta.env.VITE_MIXPANEL_TOKEN) { | ||
mixpanel.init(import.meta.env.VITE_MIXPANEL_TOKEN, { | ||
disable_cookie: true, | ||
disable_persistence: true, | ||
track_pageview: true | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import * as Sentry from '@sentry/react'; | ||
|
||
export const initializeSentry = () => { | ||
Sentry.init({ | ||
dsn: import.meta.env.VITE_SENTRY_DSN, | ||
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()], | ||
release: `penpot-exporter@${APP_VERSION}`, | ||
// Tracing | ||
tracesSampleRate: 1.0, // Capture 100% of the transactions | ||
// Session Replay | ||
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. | ||
replaysOnErrorSampleRate: 1.0 // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. | ||
}); | ||
if (import.meta.env.VITE_SENTY_DSN) { | ||
Sentry.init({ | ||
dsn: import.meta.env.VITE_SENTRY_DSN, | ||
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()], | ||
release: `penpot-exporter@${APP_VERSION}`, | ||
// Tracing | ||
tracesSampleRate: 1.0, // Capture 100% of the transactions | ||
// Session Replay | ||
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. | ||
replaysOnErrorSampleRate: 1.0 // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. | ||
}); | ||
} | ||
}; |