0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-21 21:23:06 -05:00
penpot-exporter-figma-plugin/plugin-src/getUserData.ts
Alex Sánchez a079f168df
Analytics (#228)
* metricts-sentry

* fixes

* refactor

* mixpanel integration

* improvements

* improvements

* fixes

* changeset

* fixes

* fixes

* Update .changeset/few-scissors-sleep.md

Co-authored-by: Jordi Sala Morales <jordism91@gmail.com>

* Update manifest.json

Co-authored-by: Jordi Sala Morales <jordism91@gmail.com>

* Update vite.config.ts

Co-authored-by: Jordi Sala Morales <jordism91@gmail.com>

* fixes

* fixes

* fixes

* lint

---------

Co-authored-by: Jordi Sala Morales <jordism91@gmail.com>
2024-10-28 11:22:50 +01:00

13 lines
258 B
TypeScript

export const getUserData = async () => {
const user = figma.currentUser;
if (user) {
figma.ui.postMessage({
type: 'USER_DATA',
data: {
userId: user.id
}
});
} else {
console.warn('Could not get user data');
}
};