Skip to main content
NEAR Auth lets your users sign real NEAR transactions using the Web2 identities they already have — Google, Apple, email, or passkeys — with no seed phrase and no wallet extension. Logins run through Auth0, and the signing keys are secured by a Multi-Party Computation (MPC) network, so no single party ever holds a user’s private key. Each identity deterministically derives its own NEAR key, so the same login always controls the same account. This quickstart takes you from an empty project to a signed NEAR transaction.
NEAR Auth uses Auth0 on mainnet. Mainnet requires approved credentials, so apply for access to receive your Auth0 client id before shipping. You can develop against testnet first — see the NEAR Auth docs for testnet configuration.
Pick your stack and follow the steps.

Install the SDK and provider

Add the React SDK, the JavaScript (Auth0) provider, and near-api-js.
npm install @fast-auth-near/react-sdk @fast-auth-near/javascript-provider near-api-js

Initialize the provider (mainnet)

Create a JavascriptProvider for mainnet with your client id, connect to the mainnet RPC, and wrap your app in FastAuthProvider. The provider fills in the correct Auth0 domain and signing audience for mainnet automatically.
App.tsx
import { FastAuthProvider } from "@fast-auth-near/react-sdk";
import { JavascriptProvider } from "@fast-auth-near/javascript-provider";
import { connect } from "near-api-js";

const provider = new JavascriptProvider({
  network: "mainnet",
  clientId: "<your-auth0-client-id>",
});

const { connection } = await connect({
  networkId: "mainnet",
  nodeUrl: "https://rpc.mainnet.near.org",
});

export default function App() {
  return (
    <FastAuthProvider
      providerConfig={{ provider }}
      connection={connection}
      network="mainnet"
    >
      <YourApp />
    </FastAuthProvider>
  );
}
FastAuthProvider builds a relayer-aware FastAuthClient under the hood, pointed at fast-auth.near and v1.signer. You reach it through the hooks below.

Log the user in

Grab the client with useFastAuth, check status with useIsLoggedIn, and call login() to open the Auth0 flow.
LoginButton.tsx
import { useFastAuth, useIsLoggedIn } from "@fast-auth-near/react-sdk";

function LoginButton() {
  const { client } = useFastAuth();
  const { isLoggedIn } = useIsLoggedIn();

  if (isLoggedIn) return <span>You're signed in 🎉</span>;
  return <button onClick={() => client?.login()}>Sign in</button>;
}

Get a signer and read the public key

Once the user is authenticated, obtain a signer and read the NEAR public key derived for their identity. The usePublicKey hook returns the key directly, or you can pull a signer yourself with useSigner.
AccountInfo.tsx
import { useSigner, usePublicKey } from "@fast-auth-near/react-sdk";

function AccountInfo() {
  const { signer } = useSigner();
  const { publicKey } = usePublicKey();

  return <code>{publicKey?.toString()}</code>;
}
The derived key is deterministic — the same Auth0 login always controls the same NEAR key. getPublicKey() returns an Ed25519 key by default; pass "secp256k1" if you need that curve.

Request a signature and complete the flow

Build a transfer, request the signature (this triggers an Auth0 approval), then let the relayer-backed signer submit it. In the React SDK the signer exposes signAndSendTransaction, which requests the signature, calls the NEAR Auth contract, and broadcasts the result for you.
Transfer.tsx
import { transactions } from "near-api-js";
import { useSigner, usePublicKey } from "@fast-auth-near/react-sdk";

function Transfer({ senderId, nonce, blockHash }) {
  const { signer } = useSigner();
  const { publicKey } = usePublicKey();

  async function transfer() {
    const transaction = transactions.createTransaction(
      senderId,                 // sender account id
      publicKey,                // sender's derived public key
      "receiver.near",          // receiver
      nonce,                    // account nonce
      [transactions.transfer(BigInt("1000000000000000000000000"))], // 1 NEAR
      blockHash,                // recent block hash
    );

    // Requests the Auth0 signature, submits to fast-auth.near,
    // and broadcasts via the relayer.
    const result = await signer.signAndSendTransaction({ transaction });
    console.log(result.transaction.hash);
  }

  return <button onClick={transfer}>Send 1 NEAR</button>;
}
Requesting a signature performs an Auth0 context switch — a popup or a full-page redirect, depending on how you configure the provider. Design your UX to expect it: persist any in-flight state before the call, and handle the return so users land back where they started. On redirect, the signature is retrieved on the callback page.

Learn more

You’ve completed the full loop — login, key derivation, signature, and submission. Head to the NEAR Auth documentation for the SDK reference, protocol details, and going live on mainnet.

NEAR Auth documentation

Full SDK reference, protocol concepts, and deployed contract addresses.

Apply for mainnet access

Request approved production credentials to launch on fast-auth.near.