-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edgee 406 react sdk export edgee sdk methods #7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍 I would suggest also updating the README with the new hook usage
hey @alexcasalboni , could you do a double check, I added an export of the consent method also, and included your suggestions ;) I also updated the Readme file 👍 |
We should update the documentation here too (once merged): https://www.edgee.cloud/docs/getting-started/react-sdk |
Export Edgee SDK Methods in React SDK
Description
This PR improves the Edgee React SDK by exporting the core Edgee tracking methods (
track
,user
,page
,consent
) directly. This enhancement allows developers to use the SDK methods without accessingwindow.edgee
manually, improving DX (Developer Experience), performance with the hook, and ensuring a cleaner integration, with a strong typing.Changes
track
,user
,page
andconsent
from the SDK, reducing direct interactions with the globalwindow.edgee
object.useEdgeeDataCollection()
hook for optimized tracking - The hook memoizes the tracking functions withuseCallback()
, ensuring that they do not get recreated on every render.Why This Change?
This enhancement simplifies the usage of Edgee in React applications by making
track
,user
,page
, andconsent
exports, reducing boilerplate and improving reliability.Usage Example