Integration Paths /

Privy Integration

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#

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 fieldValue
Display nameVeryAI
Client IDYour VeryAI client_id
Client secretYour VeryAI client_secret
Authorization URLhttps://connect.very.org/oauth/authorize
Token URLhttps://api.very.org/oauth2/token
Profile URLhttps://api.very.org/oauth2/userinfo
Scopesopenid
Scopes delimiterSpace
PKCEEnabled (S256)
User information sourceProfile 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#

  1. Start login from your application and choose VeryAI.
  2. Complete the palm verification flow.
  3. Confirm Privy returns an authenticated user.
  4. 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 need offline_access.
  • No user profile: confirm the Profile URL is https://api.very.org/oauth2/userinfo and 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.

VeryAI

Get the VeryAI app

Scan the QR code to download the app