@humanlayerlabs/wagmi-connector
v0.1.0
Published
HumanLayer wagmi connector — gate Web3 apps to verified humans only
Maintainers
Readme
# @humanlayerlabs/wagmi-connector
Gate your Web3 app to verified humans only. Drop-in wagmi connector powered by [HumanLayer](https://humanlayer.network).
## Install
npm install @humanlayerlabs/wagmi-connector
## Usage
import { createConfig } from 'wagmi'
import { base } from 'wagmi/chains'
import { injected, walletConnect } from 'wagmi/connectors'
import { humanlayerConnector } from '@humanlayerlabs/wagmi-connector'
export const config = createConfig({
  chains: \[base],
  connectors: \[
  injected(),
  walletConnect({ projectId: 'YOUR\_PROJECT\_ID' }),
  humanlayerConnector({
  minScore: 60, // Require Builder tier (0-144)
  blockAnomalous: true // Block Guardian-flagged accounts
  }),
  ],
})
## How it works
1. User connects their wallet as normal
2. HumanLayer silently checks their Human Score (~200ms)
3. Score meets threshold → connection succeeds
4. Score fails → HumanLayerError thrown with redirect to humanlayer.network
## Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| minScore | number | 20 | Minimum Human Score (0–144) |
| minTier | number | 1 | Minimum tier (1=Newcomer, 2=Verified, 3=Builder, 4=Elite, 5=Core) |
| blockAnomalous | boolean | true | Block accounts flagged by AI Guardian |
| errorMessage | string | — | Custom error message for blocked users |
| appId | string | — | Your HumanLayer app ID |
## Error handling
import { HumanLayerError } from '@humanlayerlabs/wagmi-connector'
const { connect } = useConnect({
  mutation: {
  onError(error) {
  if (error instanceof HumanLayerError) {
  switch (error.code) {
  case 'NOT\_VERIFIED':
  // Redirect to humanlayer.network
  break
  case 'SCORE\_TOO\_LOW':
  // Show score requirement
  console.log(error.result.score) // current score
  break
  case 'ANOMALY\_DETECTED':
  // Account flagged as suspicious
  break
  case 'TIER\_TOO\_LOW':
  // Tier requirement not met
  break
  }
  }
  }
  }
})
## Tier reference
| Score | Tier | Use case |
|-------|------|----------|
| 0–19 | Newcomer | Basic access, block bots |
| 20–59 | Verified | Standard communities |
| 60–89 | Builder | DAOs, dev tools |
| 90–119 | Elite | High-value governance |
| 120–144 | Core Human | Maximum trust |
## Links
- [HumanLayer](https://humanlayer.network)
- [Docs](https://docs.humanlayer.network)
- [GitHub](https://github.com/humanlayerlabs)
## License
MIT
