@thurinlabs/identity-kit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +157 -0
- package/dist/index.cjs +759 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +173 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +204 -0
- package/dist/index.d.ts +204 -0
- package/dist/index.js +759 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# @thurinlabs/identity-kit
|
|
2
|
+
|
|
3
|
+
React SDK for embedding Thurin identity data. Drop-in components and hooks for displaying on-chain identity claims, PGP verification, social proofs, and EFP social graph data.
|
|
4
|
+
|
|
5
|
+
A [Thurin Labs](https://thurin.id) project.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @thurinlabs/identity-kit
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Peer dependencies: `react`, `react-dom`, `wagmi`, `viem`, `@tanstack/react-query`
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { IdentityKitProvider, ScryCard } from '@thurinlabs/identity-kit'
|
|
19
|
+
import '@thurinlabs/identity-kit/styles'
|
|
20
|
+
|
|
21
|
+
function App() {
|
|
22
|
+
return (
|
|
23
|
+
<IdentityKitProvider>
|
|
24
|
+
<ScryCard ens="vitalik.eth" theme="thurin" />
|
|
25
|
+
</IdentityKitProvider>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## ScryCard
|
|
31
|
+
|
|
32
|
+
A self-contained identity card that fetches and displays all available identity data.
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
<ScryCard ens="vitalik.eth" theme="thurin" />
|
|
36
|
+
<ScryCard address="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" theme="dark" />
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Props:**
|
|
40
|
+
|
|
41
|
+
| Prop | Type | Default | Description |
|
|
42
|
+
|------|------|---------|-------------|
|
|
43
|
+
| `ens` | `string` | — | ENS name to look up |
|
|
44
|
+
| `address` | `string` | — | ETH address to look up |
|
|
45
|
+
| `theme` | `'thurin' \| 'dark' \| 'light'` | `'thurin'` | Visual theme |
|
|
46
|
+
|
|
47
|
+
**Displays:** ENS avatar, name, address, Signet seal count, verified proof count, EFP follower count, proof provider badges, and a link to the full [Scry](https://scry.thurin.id) profile.
|
|
48
|
+
|
|
49
|
+
## Provider
|
|
50
|
+
|
|
51
|
+
Wrap your app (or just the part using identity-kit) in `IdentityKitProvider`. If you already have a `WagmiProvider`, the SDK detects it and uses your existing config.
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
// Zero config — uses public RPC, no Farcaster verification
|
|
55
|
+
<IdentityKitProvider>
|
|
56
|
+
<ScryCard ens="vitalik.eth" />
|
|
57
|
+
</IdentityKitProvider>
|
|
58
|
+
|
|
59
|
+
// With options
|
|
60
|
+
<IdentityKitProvider
|
|
61
|
+
rpcUrl="https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY"
|
|
62
|
+
neynarApiKey="YOUR_NEYNAR_KEY"
|
|
63
|
+
scryBaseUrl="https://scry.thurin.id"
|
|
64
|
+
>
|
|
65
|
+
<ScryCard ens="vitalik.eth" />
|
|
66
|
+
</IdentityKitProvider>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
| Prop | Type | Default | Description |
|
|
70
|
+
|------|------|---------|-------------|
|
|
71
|
+
| `rpcUrl` | `string` | publicnode | Ethereum RPC endpoint |
|
|
72
|
+
| `neynarApiKey` | `string` | — | Neynar API key for Farcaster proof verification |
|
|
73
|
+
| `scryBaseUrl` | `string` | `https://scry.thurin.id` | Base URL for "View on Scry" links |
|
|
74
|
+
|
|
75
|
+
## Hooks
|
|
76
|
+
|
|
77
|
+
For custom UI, use the hooks directly instead of `ScryCard`.
|
|
78
|
+
|
|
79
|
+
### useScryIdentity
|
|
80
|
+
|
|
81
|
+
Combined identity data — ENS, Signet claims, PGP proofs, and EFP social graph.
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
const identity = useScryIdentity('vitalik.eth')
|
|
85
|
+
// or
|
|
86
|
+
const identity = useScryIdentity('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045')
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Returns: `ScryIdentity` with `address`, `ensName`, `ensAvatar`, `claims`, `totalClaims`, `activeClaims`, `currentFingerprint`, `pgpKeyInfo`, `proofs`, `efp`, `isLoading`, `error`.
|
|
90
|
+
|
|
91
|
+
### useSignetClaims
|
|
92
|
+
|
|
93
|
+
On-chain attestation data from the PGPRegistry contract.
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
const { claims, totalClaims, activeClaims, currentFingerprint, isLoading } =
|
|
97
|
+
useSignetClaims('0xd8dA...')
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### useEFPGraph
|
|
101
|
+
|
|
102
|
+
EFP (Ethereum Follow Protocol) social graph data.
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
const { efp, isLoading } = useEFPGraph('0xd8dA...')
|
|
106
|
+
// efp.followers, efp.following, efp.top8, efp.hasEfp
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### usePGPProofs
|
|
110
|
+
|
|
111
|
+
PGP key info and verified social proofs from keyserver.
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
const { keyInfo, proofs, isLoading } = usePGPProofs('03E53D807CE38C...')
|
|
115
|
+
// proofs[].provider, proofs[].status, proofs[].displayUrl
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Themes
|
|
119
|
+
|
|
120
|
+
Three built-in themes: `thurin`, `dark`, `light`. All styles are scoped under `[data-scry-theme]` with `scry-` prefixed class names to avoid conflicts with your app's styles.
|
|
121
|
+
|
|
122
|
+
Import styles when using `ScryCard`:
|
|
123
|
+
|
|
124
|
+
```tsx
|
|
125
|
+
import '@thurinlabs/identity-kit/styles'
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Hooks-only consumers don't need to import styles.
|
|
129
|
+
|
|
130
|
+
## Supported Proof Providers
|
|
131
|
+
|
|
132
|
+
| Provider | Proof Method |
|
|
133
|
+
|----------|-------------|
|
|
134
|
+
| GitHub | Public gist |
|
|
135
|
+
| DNS | TXT record |
|
|
136
|
+
| Farcaster | Public cast (requires Neynar API key) |
|
|
137
|
+
| Codeberg | Repository description |
|
|
138
|
+
| Mastodon | Profile metadata |
|
|
139
|
+
|
|
140
|
+
## Development
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
npm install
|
|
144
|
+
npm run build
|
|
145
|
+
npm test
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Links
|
|
149
|
+
|
|
150
|
+
- [Scry](https://scry.thurin.id) — Identity explorer
|
|
151
|
+
- [Signet](https://signet.thurin.id) — Create identity claims
|
|
152
|
+
- [Documentation](https://docs.thurin.id)
|
|
153
|
+
- [Codeberg](https://codeberg.org/thurinlabs/identity-kit)
|
|
154
|
+
|
|
155
|
+
## License
|
|
156
|
+
|
|
157
|
+
MIT
|