# AgentProvider

**Slug:** `agent-provider`  
**Import:** `import { AgentProvider } from "@p4n/erc8004-ui"`

> **NOTE — unofficial library.** `@p4n/erc8004-ui` is an independent, community-built project. It is not affiliated with, maintained by, or endorsed by the authors of ERC-8004. It reads the standard's on-chain data through public subgraphs; it does not speak for the standard.

## Description

Optional convenience wrapper that sets a default agentRegistry and agentId for all child components. Eliminates prop repetition on profile pages. Components inside can still override with their own props.

## Usage

```tsx
import { AgentProvider } from "@p4n/erc8004-ui"
import { AgentProvider, AgentName, ReputationScore, FeedbackList } from "@p4n/erc8004-ui"

// Profile page — one agent, many components, no repetition:
<AgentProvider agentRegistry="eip155:8453:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432" agentId={888}>
  <AgentName />
  <ReputationScore />
  <FeedbackList />
</AgentProvider>

// Override one component inside the provider:
<AgentProvider agentRegistry="eip155:8453:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432" agentId={888}>
  <AgentName />
  <AgentName agentRegistry="eip155:1:0x999..." agentId={12} />
</AgentProvider>
```

## API Reference

| Prop | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `agentRegistry` | `string` | yes | — | Agent registry identifier in the format "eip155:{chainId}:{contractAddress}". |
| `agentId` | `number` | yes | — | ERC-721 token ID of the agent. |
| `children` | `ReactNode` | yes | — | Components that will inherit this agent identity. |

## Reference

- Live preview & full docs: https://erc8004-ui.vercel.app/docs/components/agent-provider
- Markdown source: https://erc8004-ui.vercel.app/docs/components/agent-provider.md
