Integrate VeryAI with Privy
Add VeryAI palm verification to a Privy app as a custom OAuth provider. Privy handles the OAuth callback and token exchange, then uses the stable, app-scoped VeryAI sub value to identify the user. No custom token bridge is required.
Before you start#
- A VeryAI application with a
client_idandclient_secret. See Getting Started. - A Privy app with access to custom OAuth providers.
1. Register the Privy callback in VeryAI#
In the Developer Portal, open your VeryAI application and add this redirect URI exactly:
https://auth.privy.io/api/v1/oauth/callback
Copy the application's client_id and client_secret. Keep the client secret server-side and enter it only in Privy's dashboard.
2. Add VeryAI in Privy#
In Privy Dashboard, go to Settings → Login methods, select Add Custom Provider, and use these values:
| Privy field | Value |
|---|---|
| Display name | VeryAI |
| Client ID | Your VeryAI client_id |
| Client secret | Your VeryAI client_secret |
| Authorization URL | https://connect.very.org/oauth/authorize |
| Token URL | https://api.very.org/oauth2/token |
| Profile URL | https://api.very.org/oauth2/userinfo |
| Scopes | openid |
| Scopes delimiter | Space |
| PKCE | Enabled (S256) |
| User information source | Profile endpoint |
VeryAI's UserInfo response returns sub, a stable pairwise identifier for the user in your application. If Privy asks for the unique user ID field, enter sub. Do not add profile or email scopes; VeryAI currently supports openid and optional offline_access only.
3. Use the provider in your app#
Install Privy's React SDK and wrap your application with PrivyProvider. To provision an Ethereum embedded wallet after login, enable automatic wallet creation:
npm install @privy-io/react-auth import { PrivyProvider } from '@privy-io/react-auth';
export function Providers({ children }) {
return (
<PrivyProvider
appId="your-privy-app-id"
config={{
embeddedWallets: {
ethereum: {
createOnLogin: 'users-without-wallets',
},
},
}}
>
{children}
</PrivyProvider>
);
}
Once the custom provider is saved in Privy, it appears in Privy's login modal. Open the modal with useLogin:
import { useLogin, usePrivy } from '@privy-io/react-auth';
export function SignIn() {
const { ready, authenticated } = usePrivy();
const { login } = useLogin();
if (!ready || authenticated) return null;
return <button onClick={() => login()}>Sign in</button>;
} 4. Test the flow#
- Start login from your application and choose VeryAI.
- Complete the palm verification flow.
- Confirm Privy returns an authenticated user.
- If automatic wallet creation is enabled, confirm the user has an embedded wallet.
Test with separate VeryAI and Privy development apps before configuring production. Privy notes that a custom provider's fields cannot be changed after users have been created with it.
Troubleshooting#
- Redirect URI error: confirm the Privy callback is registered exactly in the same VeryAI application whose credentials you entered in Privy.
- Invalid scope: use only
openid, unless you also needoffline_access. - No user profile: confirm the Profile URL is
https://api.very.org/oauth2/userinfoand the user information source is set to Profile endpoint.
For the underlying VeryAI flow and endpoint behavior, see OAuth2 Integration and the OAuth API Reference.