Skip to content

docs: Privy v3 integration example needed — OnboardPrivyOptions.privy.resolve API is underdocumented #56

@nagavaishak

Description

@nagavaishak

Summary

The OnboardStrategy.Privy integration is missing a practical end-to-end example. The OnboardPrivyOptions.privy.resolve function requires returning { walletId, publicKey, rawSign? }, but there's no documentation on how to implement rawSign with Privy v3's server auth SDK (@privy-io/server-auth).

Problem

When building with Privy v3 (@privy-io/react-auth v3.x), the client-side wallet API differs significantly from earlier versions. Specifically:

  1. How to obtain walletId from a Privy embedded Starknet wallet using v3 client SDK
  2. How to implement rawSign(walletId, messageHash) using PrivyClient.walletApi.rpc with caip2: "starknet:SN_SEPOLIA"
  3. How to bridge the Privy auth token from client → server for signing

Suggested Fix

Add a complete Next.js App Router example showing:

// pages/api/sign.ts (server-side Privy signing proxy)
import { PrivyClient } from "@privy-io/server-auth";

const privy = new PrivyClient(appId, appSecret);

// rawSign implementation for StarkZap OnboardStrategy.Privy
async function rawSign(walletId: string, hash: string): Promise<string> {
  const { data } = await (privy.walletApi.rpc as any)({
    walletId,
    method: "starknet_signMessage",
    params: { message: hash },
    caip2: "starknet:SN_SEPOLIA",
  });
  return data.signature;
}

Environment

  • starkzap v1.0.0
  • @privy-io/react-auth v3.15.0
  • @privy-io/server-auth v1.32.5
  • Next.js 16 App Router
  • Starknet Sepolia

Reference

Built this integration in StarkFolio (hackathon project): https://github.com/nagavaishak/StarkFolio

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions