-
Notifications
You must be signed in to change notification settings - Fork 8
add privy login support #537
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
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.
Pull Request Overview
This PR adds support for Privy authentication as an alternative to the existing Geo Connect authentication flow. The implementation creates a dual-authentication system where users can authenticate either through the traditional Geo Connect flow or through the new Privy authentication.
- Adds a new
PrivatePrivyAppIdentity
type and authentication flow that works alongside existing identity types - Integrates Privy authentication into the server websocket handling and React hooks
- Creates a new example application demonstrating Privy login functionality
Reviewed Changes
Copilot reviewed 82 out of 86 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
packages/hypergraph/src/store.ts | Adds Privy identity state management with new state fields and action handlers |
packages/hypergraph/src/privy-auth/privy-auth.ts | Implements core Privy authentication logic including signup, login, and key management |
packages/hypergraph/src/connect/types.ts | Defines the PrivatePrivyAppIdentity type for Privy-based authentication |
packages/hypergraph-react/src/HypergraphAppContext.tsx | Updates React context to handle dual authentication states and Privy websocket connections |
packages/hypergraph-react/src/hooks/*.ts | Updates React hooks to work with both authentication types |
apps/server/src/websocket.ts | Adds server-side support for Privy authentication in websocket connections |
apps/privy-login-example/ | Complete example application demonstrating Privy authentication integration |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
apps/server/src/websocket.ts:1
- The condition check is inverted. It should be
if (!signaturePrivateKey)
to check for missing signature private key, not the presence of it.
import * as HttpLayerRouter from '@effect/platform/HttpLayerRouter';
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
}>) => { | ||
if (!identity) { | ||
if (!identity && !privyIdentity) { | ||
throw new Error('No identity found'); |
Copilot
AI
Sep 16, 2025
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.
There's an extra space in the error message. It should be 'No identity found' instead of 'No identity found'.
throw new Error('No identity found'); | |
throw new Error('No identity found'); |
Copilot uses AI. Check for mistakes.
console.log('smartAccountWalletClient', smartAccountWalletClient); | ||
console.log('address', smartAccountWalletClient.account.address); | ||
console.log('is deployed', await isSmartAccountDeployed(smartAccountWalletClient)); |
Copilot
AI
Sep 16, 2025
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.
These console.log statements should be removed from production code or replaced with proper logging.
Copilot uses AI. Check for mistakes.
console.log('identity', identity); | ||
console.log('privyIdentity', privyIdentity); |
Copilot
AI
Sep 16, 2025
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.
These console.log statements should be removed from production code or replaced with proper logging.
Copilot uses AI. Check for mistakes.
console.log('is deployed', await isSmartAccountDeployed(smartAccountWalletClient)); | ||
// This will prompt the user to sign a user operation to update the smart account | ||
if (await smartAccountNeedsUpdate(smartAccountWalletClient, chain, rpcUrl)) { | ||
console.log('updating smart account'); |
Copilot
AI
Sep 16, 2025
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.
This console.log statement should be removed from production code or replaced with proper logging.
Copilot uses AI. Check for mistakes.
// Create the client again to ensure we have the 7579 config now | ||
return getSmartAccountWalletClient(smartAccountParams); | ||
} | ||
console.log('leaving getAndUpdateSmartAccount'); |
Copilot
AI
Sep 16, 2025
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.
This console.log statement should be removed from production code or replaced with proper logging.
console.log('leaving getAndUpdateSmartAccount'); |
Copilot uses AI. Check for mistakes.
No description provided.