Skip to main content
Authenticate a user and mint 1 mUSD, a test token on Base Sepolia. Your application sponsors the transaction, so the user needs no tokens or gas to get started.

Prerequisites

  • A browser application served over HTTPS. The hosted provider does not accept plain http://localhost; use local HTTPS for development.
  • An application and its domains registered in the Dashboard.
  • A device or browser that supports passkeys.
1

Install the SDK

2

Configure application credentials

Create a JWT signing key in the Dashboard, then follow the Embedded wallet tab in Sponsorship setup to implement two same-origin backend endpoints:
  • GET /api/sponsorship/access-token authenticates your app and project.
  • POST /api/sponsorship/extension-token authorizes sponsorship for the intent.
Keep the private signing key on your backend. Authenticate your application session and apply issuance checks before minting tokens.
Application credentials are required for every intent, even when the user pays. Without sponsorship configured, sendIntent returns MISSING_APP_CREDENTIALS.
3

Initialize the client

Create oneauth.ts using the shared client initialization. Replace my-app with your registered client ID and point sponsorship at the endpoints above. Reuse its exported oneAuth client in the next step.Passkeys are created and used in your page. Each hostname has its own passkey and smart-account namespace by default. See Passkeys and domains before sharing accounts across subdomains.
4

Send your first transaction

Call mintTestToken() from a button in your browser application. Authentication creates a wallet for a new user or signs in to an existing one; the user then authorizes the mint with their passkey.
There are no tokenRequests: the call mints tokens directly to the account, so nothing needs to be sourced or bridged. Sponsorship covers the fees; required fails rather than falling back to a user-paid transaction.

Expected outcome

After the transaction completes, your account receives 1 mUSD on Base Sepolia. closeOn: "completed" keeps the dialog open until completion, and the example logs the intent ID. Inspect your account on Base Sepolia’s explorer to verify the mint.

Next steps