<!-- tempo-docs-context -->
> Source: [/docs/guide/payments/sponsor-user-fees](https://tempo.xyz/developers/docs/guide/payments/sponsor-user-fees.md)
> Section: [Accounts](https://tempo.xyz/developers/docs/accounts.md). Create accounts, connect wallets, read balances, send and receive payments, and reconcile deposits.
> [Documentation index](https://tempo.xyz/developers/llms.txt) · [Docs skill](https://tempo.xyz/developers/SKILL.md)

> Tempo MCP: Use `search`, `find_pages`, `read_page`, and `code` at `https://mcp.tempo.xyz` for Tempo and related documentation.
> If an indexed page is missing or reflects an older site, read this site’s [documentation index](https://tempo.xyz/developers/llms.txt) and Markdown pages directly.

<span id="sponsor-user-fees-with-feepayer" />

# Sponsor fees

Pay transaction fees on behalf of your users. A fee payer service signs the fee authorization; the sender still signs the payment and supplies the funds being transferred.

## Fee sponsorship demo

**Interactive demo: Sponsor User Fees**

1. Connect
2. Add funds
3. Send relayer sponsored payment

## Fee sponsorship implementation steps

::::steps
### Set up the fee payer service

#### Hosted

See the [Fee Payer API guide](https://tempo.xyz/developers/docs/api/fee-payer) to set up authenticated production (and sandbox) sponsorship.

#### Self-hosted

Use the [Relay & Fee Payer Handler](https://tempo.xyz/developers/docs/server/relay-handler) to run a fee payer service with your own sponsorship policy.

:::info
For testing on Tempo testnet, use the public fee payer endpoint at `https://sponsor.moderato.tempo.xyz` without an API key.
:::

### Configure your client to use the fee payer service

:::code-group
```ts twoslash [Tempo Wallet]
// @noErrors
import { tempoModerato } from 'viem/chains'
import { createConfig, http } from 'wagmi'
import { tempoWallet } from 'wagmi/connectors'

export const config = createConfig({
  connectors: [tempoWallet({
    feePayer: 'https://sponsor.moderato.tempo.xyz', // [!code focus]
  })],
  chains: [tempoModerato],
  multiInjectedProviderDiscovery: false,
  transports: {
    [tempoModerato.id]: http(),
  },
})
```

```ts twoslash [WebAuthn + Other]
// @noErrors
import { tempoModerato } from 'viem/chains'
import { withRelay } from 'viem/tempo'
import { createConfig, http } from 'wagmi'
import { webAuthn } from 'wagmi/tempo'

export const config = createConfig({
  connectors: [webAuthn({ authUrl: '/auth' })],
  chains: [tempoModerato],
  multiInjectedProviderDiscovery: false,
  transports: {
    [tempoModerato.id]: withRelay( // [!code focus]
      http(), // [!code focus]
      http('https://sponsor.moderato.tempo.xyz'), // [!code focus]
    ), // [!code focus]
  },
})
```
:::

### Sponsor your user's transactions

Set `feePayer: true` to request sponsorship from the configured fee payer service. For more details on how to send a transaction, see the [Send a payment](https://tempo.xyz/developers/docs/guide/payments/send-a-payment) guide.

:::code-group
```tsx twoslash [SendSponsoredPayment.tsx] filename="SendSponsoredPayment.tsx"
import { Hooks } from 'wagmi/tempo'
import { getAddress, parseUnits } from 'viem'

const alphaUsd = '0x20c0000000000000000000000000000000000001'

// @noErrors
function SendSponsoredPayment() {
  const sendPayment = Hooks.token.useTransferSync() // [!code hl]

  return (
    <form onSubmit={
      (event) => {
        event.preventDefault()
        const formData = new FormData(event.target as HTMLFormElement)

        const recipient = getAddress(String(formData.get('recipient')))

        sendPayment.mutate({ // [!code hl]
          amount: parseUnits('100', 6), // [!code hl]
          feePayer: true, // [!code focus]
          to: recipient, // [!code hl]
          token: alphaUsd, // [!code hl]
        }) // [!code hl]
      }
    }>
      <div>
        <label htmlFor="recipient"> Recipient address </label>
        <input type="text" name="recipient" placeholder="0x..." required />
      </div>
      <button type="submit" disabled={sendPayment.isPending}>
        Send Payment
      </button>
    </form>
  )
}
```

```tsx twoslash [wagmi.config.ts] filename="wagmi.config.ts"
// @noErrors
import { tempoModerato } from 'viem/chains'
import { createConfig, http } from 'wagmi'
import { tempoWallet } from 'wagmi/connectors'

export const config = createConfig({
  connectors: [
    tempoWallet({
      feePayer: {
        precedence: 'user-first',
        url: 'https://sponsor.moderato.tempo.xyz',
      },
    }),
  ],
  chains: [tempoModerato],
  multiInjectedProviderDiscovery: false,
  transports: {
    [tempoModerato.id]: http(),
  },
})
```
:::

### Next steps for fee sponsorship

* Learn more about the [Tempo Transaction](https://tempo.xyz/developers/docs/protocol/transactions/spec-tempo-transaction#fee-payer-signature-details) type and fee payer signature details
* Use Tempo Transactions to sponsor multiple calls in a single signed operation
* Learn how to [Choose a fee token](https://tempo.xyz/developers/docs/guide/payments/pay-fees-in-any-stablecoin)
::::

## Fee sponsorship best practices

Configure the fee payer service to check the sender, target contracts, allowed methods, and spending budget before signing. Track sponsored fees against your application or customer records, and show the sender when your application covers the fee.

### Fee sponsorship security considerations

A fee payer signs a specific transaction; sponsorship does not grant authority to sign other transactions from the sender’s account. See [fee payer signature details](https://tempo.xyz/developers/docs/protocol/transactions/spec-tempo-transaction#fee-payer-signature-details) for the fields each signer commits to.

## Fee sponsorship learning resources

* [Fee Specification](https://tempo.xyz/developers/docs/protocol/fees/spec-fee) — Learn more about fees and how they work on Tempo
* [TempoTransaction Spec](https://tempo.xyz/developers/docs/protocol/transactions/spec-tempo-transaction) — Technical specification for TempoTransactions and fee payer signature details
* [Choose a fee token](https://tempo.xyz/developers/docs/guide/payments/pay-fees-in-any-stablecoin) — Understand fee token selection and how to pay with different stablecoins
