Get a signer
After login, obtain aFastAuthSigner from the client. The signer is bound to the logged-in identity and is what you use to request signatures, derive keys, and build the on-chain call.
- Browser / JS
- React
Request a transaction signature
Build a standardnear-api-js transaction, then hand it to the signer. Use getPublicKey() to fetch the sender’s MPC-derived key so the transaction is built against the correct account.
redirectUri is where the flow returns after the user approves. Auth0 embeds the encoded transaction in the JWT’s fatxn claim, which the NEAR Auth contract verifies before any signature is produced.
Complete the signing flow
On your callback route, read the approved signature request back out of the provider and turn it into an on-chainsign action. That action targets the NEAR Auth contract, which verifies the JWT and asks the MPC network to sign.
createSignAction wraps a sign function call with guard_id, verify_payload, sign_payload, and algorithm taken from the signature request — the exact arguments the contract’s sign method expects. gas defaults to 300000000000000n and deposit to 0n if you omit the options. See the NEAR Auth contract for how this call is processed.
Delegate actions for gasless transactions
A delegate action is a signed intent that a relayer wraps in a meta-transaction and submits — paying the gas so your users can transact without holding NEAR. Build aDelegateAction and request a signature the same way you would a transaction.
getSignatureRequest() (read .signatureRequest off the result) and hand the signed delegate action to a relayer. The relayer wraps it in a meta-transaction and submits it, covering the gas so nothing is charged to the end user. Read more about how submission works on the relayer concept page.
Relayer-backed convenience methods (React)
The React SDK’s signer bundles a relayer, so you can request approval and submit in a single call.signAndSendTransaction and signAndSendDelegateAction handle the request, retrieve the signature request, relay it, and return the final execution outcome.
eddsa MPC algorithm; pass algorithm to override. Because they relay the transaction for you, they return a FinalExecutionOutcome rather than an action you have to submit yourself.
These convenience methods are specific to the React SDK. With the framework-agnostic Browser SDK you assemble and submit the transaction yourself using
createSignAction and your own relayer or RPC connection.Get the user’s public key
Every identity deterministically derives its own NEAR key through the MPC network. Fetch it to build transactions or create an account for the user.getPublicKey defaults to ed25519; pass an algorithm to derive a different curve.
derived_public_key view at the user’s authentication path, so the same login always resolves to the same NEAR account.
Next steps
How MPC signing works
How distributed key shares produce a signature without ever assembling a private key.
Relayer & gasless flows
How a relayer wraps delegate actions in meta-transactions and sponsors gas.
The NEAR Auth contract
How the on-chain contract verifies the JWT and requests the MPC signature.
Authenticate users
Log users in and manage sessions before requesting signatures.