@solana/kit, so a Kit app needs no bridge at all. Cloak’s own
types are Kit types:
connectionis aCloakRpcfromcreateCloakRpc(rpcUrl), not a web3.jsConnection.programId, mints and recipients are KitAddressstrings, notPublicKeyinstances.depositorKeypairis a KitKeyPairSigner, andsigneris a Kit transaction signer.
@solana/web3.js is now an optional peer dependency. The only thing that still needs it is the
browser wallet-adapter bridge, which hands the wallet a VersionedTransaction to sign.
Which half of this page is yours
Kit apps come in two shapes, and they diverge at the first flow that is submitted for you. A deposit is signed by the funding wallet and posted directly. A private send, a withdrawal or a swap is submitted on your behalf, and each of those requests carries an authenticated sender signed by the end user’s own wallet.Install
@solana/web3.js, which the adapter bridge needs:
The endpoint value
The submission endpoint is pinned when the SDK is built, and the SDK reads no environment variable for it. Pass the exported constant rather than a host you typed or a value you read from the environment:CLOAK_RELAY_URL is a convention that the SDK’s own examples and scripts read themselves and pass
in as relayUrl. If your Kit app does the same, it is your code doing the reading, and the value
still has to be an origin on this build’s allowlist or the call throws. There is no default:
omitting relayUrl yields undefined, never production.
A published build reaches exactly one submission endpoint and cannot be repointed by a Kit app, or
any other consumer. See Pointing at a non-production
endpoint.
Wiring a browser Kit app
Wrap the connected wallet adapter withsignerFromWalletAdapter and pass the result as signer.
No secret key ever exists in your app.
signerFromWalletAdapter throws if the adapter has no publicKey (not connected). It always
provides transaction signing; it adds message signing only when the adapter exposes signMessage.
That matters because a wallet without signMessage authenticates requests by signing a
deterministic no-op transaction instead — the path a Ledger or Trezor takes. Either way the
authenticated sender must be the end user’s own wallet, never an ephemeral or service-held key.
Wiring a server or CLI Kit app
Load the secret key into aKeyPairSigner and pass it as depositorKeypair.
generateKeyPairSigner() gives a throwaway signer for tests, and signerFromKeypair({ secretKey })
accepts an object that already carries raw secret-key bytes.
Migration history: coming from web3.js
This section is historical, for upgrading an integration written against 0.2.4 or earlier. Every example above already uses the current 0.2.5 Kit API; nothing here is a current instruction.Related pages
Request authentication
Why sends need a signed sender, the approval window, and both signer shapes.
Wallet integration
Full wallet-adapter wiring, progress callbacks and stale-root retries.
Code examples
Concise snippets to adapt to your Kit app runtime.
Error handling
CloakError categories, parseError, and the stale-root retry template.Note storage
Where change notes have to be written down, and what each storage export carries.