-
Notifications
You must be signed in to change notification settings - Fork 18
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
react-native-sessions #504
base: main
Are you sure you want to change the base?
Conversation
New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
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.
LG at a glance. need to add to the package to code sandbox ci json
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 great! left a few comments
type Session = { | ||
publicKey: string; | ||
privateKey: string; | ||
expiry: number; | ||
}; |
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.
Should we add any additional info here like the organizationId? Sometimes that can be helpful but maybe it is stored somewhere else in the react-native-demo
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.
If we were to do this then I think we should store the entire User object as well. Currently we store the user (and org id) in the turnkey provider here: https://github.com/tkhq/react-native-demo-wallet/blob/main/providers/turnkey.tsx.
Overall I am not strongly opinionated on this, I am fine with whatever decision you make
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.
if we add it here that would mean we wouldn't need to fetch the orgId here I think right?
I would say lets store the User object, since we do this in the sdk-browser? 🤔
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.
makes sense - going to get started on this now
Summary & Motivation
Session management is tedious to do in RN - so we abstract it :)
How I Tested These Changes
I made a local build and tried it in the react-native-demo-wallet
Did you add a changeset?
If updating one of our packages, you'll likely need to add a changeset to your PR. To do so, run
pnpm changeset
.pnpm changeset
will generate a file where you should write a human friendly message about the changes. Note how this (example) includes the package name (should be auto added by the command) along with the type of semver change (major.minor.patch) (which you should set).These changes will be used at release time to determine what packages to publish and how to bump their version. For more context see this comment.