Skip to main content
Privy’s hosted connect and transact pages serve EVM connections only. A provider that shares Solana wallets builds both pages itself with @privy-io/cross-app-provider, then points custom_connect_url and custom_transact_url at them. There is no hosted option.
@privy-io/cross-app-provider is a vanilla JavaScript library. Pair it with @privy-io/react-auth to resolve and sign with the user’s embedded Solana wallet.

What a Solana provider owns

Create the client

Build the connect page

Read the request, then resolve an address for the namespace it asks for.
getConnectionRequestFromUrlParams throws on a chain parameter it does not recognize as a CAIP-2 chain ID. getRequestNamespace returns 'eip155' when chain is absent, which only ever meant EVM. The provider writes its own embedded-wallet predicates. react-auth’s isPrivyWallet is @internal and not importable, and the two wallet hooks return different shapes, so the checks cannot be shared:
The Solana predicate also excludes a cross-app wallet registered by @privy-io/cross-app-connect. That wallet advertises neither the Privy name nor a privy: feature, by design. Resolve the wallet for that namespace and nothing else:
Two rules matter here:
  • Never fall back to a wallet on another chain. A Solana requester would silently receive an Ethereum address.
  • Pick an embedded wallet, not the first entry a wallet hook returns. Both lists also carry injected wallets. A browser extension such as Phantom registers as an EVM provider and a Solana Wallet Standard wallet at once. Lending one asks the user’s own extension to sign for the requester, with a wallet the provider does not custody.
Call client.rejectConnection({accessToken, callbackUrl: connectionRequest.callbackUrl}) when the user declines.

Build the transact page

getVerifiedTransactionRequest decrypts the request and verifies it before returning. It confirms the connection exists, has not expired, and belongs to the logged-in user. It then binds the request two ways. It rejects a request whose namespace differs from the one the user approved at connect. On Solana, it also rejects a request that names an account other than the one that connection carries. A requester therefore cannot substitute a different wallet the user owns. For known Solana methods it validates the params shape too. An unrecognized method passes through.
The namespace and the account come back verified, so read the account from connection.address rather than out of params. request.chain is the requester’s claim within that namespace. Compare it against connection.chain if the cluster matters.

Sign the request

Branch on request.method, then sign with the matching react-auth hook:
Read params[0] with parseSolanaSignTransactionParams for both transaction methods, or with parseSolanaSignMessageParams for solana:signMessage. toSolanaChainAlias maps the genesis-hash chain ID to the alias form react-auth takes. It throws on an unrecognized chain rather than defaulting to a cluster. Signing against the wrong cluster is unrecoverable once broadcast. Report failures with client.handleError({accessToken, error, callbackUrl: connection.callbackUrl, chain: request.chain}), and user rejections with client.rejectRequest.

Suppress Privy’s wallet UI

Pass {uiOptions: {showWalletUIs: false}} on every signing call. The provider’s page is already the consent surface, so Privy’s UIs would ask for a second approval. Those UIs also end on a terminal success screen. They hold the signing promise pending until the user dismisses it, so the requester waits out its full timeout after a successful signature.

Broadcast and confirmation

The provider submits the transaction, so broadcast policy is the provider’s call. Set optimisticBroadcast: true to return the signature as soon as the cluster accepts the broadcast. Polling for confirmation instead holds the popup open past the requester’s timeout. A confirmation failure there also turns an already-broadcast transaction into a reported error. The requester holds the RPC connection, so confirmation belongs to it.

Match the wire encodings

signAndSendTransaction returns the only base58 result.

Reply transport

This package always answers over postMessage. It never reads the requester’s communication_mode parameter, and every call site leaves its internal mode at the message default. Ask requesters for message so both sides agree. The @privy-io/cross-app-connect/solana adapter already defaults to it. A requester calling createPrivyCrossAppClient directly defaults to redirect, so it must set communicationMode: 'message' explicitly.