Skip to content

Commit 4ec03ba

Browse files
Blackman99claude
andcommitted
docs: API key is optional, fix layer cross-references
- REST API, demo, and skill docs: mark API key as optional - Demo api.ts: only send X-Api-Key header when configured - Fix layer1-product links to match current doc structure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cfe0421 commit 4ec03ba

6 files changed

Lines changed: 18 additions & 24 deletions

File tree

docs/api/rest-api.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ TxGraph components are designed to work with the **TrustIn graph_explore API**.
44

55
## Authentication
66

7-
Contact [info@trustin.info](mailto:info@trustin.info) to obtain an API key.
8-
9-
Include the key in all requests:
7+
The TrustIn API works without an API key. You can optionally include one for higher rate limits:
108

119
```
1210
X-Api-Key: your_api_key_here
1311
```
1412

13+
Contact [info@trustin.info](mailto:info@trustin.info) to obtain an API key for production use.
14+
1515
## Endpoints
1616

1717
### `POST /api/v1/graph_explore`
@@ -25,7 +25,6 @@ Explore transaction graph starting from a given address.
2525
```http
2626
POST /api/v1/graph_explore
2727
Content-Type: application/json
28-
X-Api-Key: your_api_key_here
2928
```
3029

3130
```json
@@ -98,8 +97,8 @@ X-Api-Key: your_api_key_here
9897
```json
9998
{
10099
"success": false,
101-
"error": "Invalid API key",
102-
"code": 401
100+
"error": "Rate limit exceeded",
101+
"code": 429
103102
}
104103
```
105104

docs/guide/claude-code-skill.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ The `/trace-graph` skill guides you through specifying parameters, starts the lo
1010

1111
- [Claude Code](https://claude.com/claude-code) installed
1212
- Node.js >= 18, pnpm >= 8
13-
- A TrustIn API key (contact [info@trustin.info](mailto:info@trustin.info))
1413

1514
## Usage
1615

@@ -41,7 +40,6 @@ You'll be prompted for:
4140
### 2. Environment Setup
4241

4342
Claude checks that everything is ready:
44-
- Creates `examples/local-demo/.env` with your API key if missing
4543
- Installs dependencies if needed
4644
- Builds the core `@trustin/txgraph` package
4745

docs/guide/layer1-product.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ Switch between two renderers:
5151
✅ Full feature set including AI risk scoring
5252
✅ Regular compliance checks
5353

54-
→ For programmatic access or embedding in your own app, see [Layer 2: Run Demo Locally](/guide/layer2-demo) or [Layer 3: Build Your Own](/guide/layer3-component).
54+
→ For programmatic access, see [Layer 2: AI Agent API](/guide/layer2-agent). To run locally, see [Layer 3: Local Demo](/guide/layer3-demo). To embed in your own app, see [Layer 4: Build Your Own](/guide/layer4-component).

docs/guide/layer3-demo.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Run TxGraph as a local Vite app connected to the TrustIn API. Ideal for evaluati
66

77
- **Node.js** ≥ 18
88
- **pnpm** ≥ 8 (`npm i -g pnpm`)
9-
- A **TrustIn API key** (contact [info@trustin.info](mailto:info@trustin.info))
109

1110
## Quick Start
1211

@@ -18,19 +17,15 @@ cd txgraph
1817
# 2. Install dependencies
1918
pnpm install
2019

21-
# 3. Configure your API key
22-
cp examples/local-demo/.env.example examples/local-demo/.env
23-
# Edit .env and set VITE_TRUSTIN_API_KEY=your_key_here
24-
25-
# 4. Start the demo
20+
# 3. Start the demo
2621
pnpm dev:demo
2722
```
2823

2924
Open [http://localhost:5173](http://localhost:5173)
3025

31-
## Configuration
26+
## Configuration (Optional)
3227

33-
Edit `examples/local-demo/.env`:
28+
The demo works out of the box without any API key. For higher rate limits, create `examples/local-demo/.env`:
3429

3530
```env
3631
VITE_TRUSTIN_API_URL=https://api.trustin.info
@@ -40,7 +35,7 @@ VITE_TRUSTIN_API_KEY=your_api_key_here
4035
| Variable | Default | Description |
4136
|----------|---------|-------------|
4237
| `VITE_TRUSTIN_API_URL` | `https://api.trustin.info` | API base URL |
43-
| `VITE_TRUSTIN_API_KEY` || Your API key (required) |
38+
| `VITE_TRUSTIN_API_KEY` || Optional API key for higher rate limits |
4439

4540
## Using the Demo
4641

examples/local-demo/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ export default function App() {
321321
<div style={{ height: '100%', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 12, color: c.dimmed }}>
322322
<div style={{ fontSize: 48 }}>🔍</div>
323323
<div style={{ fontSize: 15 }}>Enter an address and click <strong>Explore</strong></div>
324-
<div style={{ fontSize: 12, color: c.dimmed }}>Requires a TrustIn API key in <code>.env</code></div>
324+
<div style={{ fontSize: 12, color: c.dimmed }}>Powered by TrustIn API</div>
325325
</div>
326326
)}
327327
{(graph || loading) && (

examples/local-demo/src/api.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ export interface GraphExploreParams {
1212

1313
export async function exploreGraph(params: GraphExploreParams): Promise<TxGraph> {
1414
const apiUrl = import.meta.env.VITE_TRUSTIN_API_URL || 'https://api.trustin.info'
15-
const apiKey = import.meta.env.VITE_TRUSTIN_API_KEY as string
15+
const apiKey = import.meta.env.VITE_TRUSTIN_API_KEY as string | undefined
16+
17+
const headers: Record<string, string> = {
18+
'Content-Type': 'application/json',
19+
}
20+
if (apiKey) headers['X-Api-Key'] = apiKey
1621

1722
const res = await fetch(`${apiUrl}/api/v1/graph_explore`, {
1823
method: 'POST',
19-
headers: {
20-
'Content-Type': 'application/json',
21-
'X-Api-Key': apiKey,
22-
},
24+
headers,
2325
body: JSON.stringify({
2426
address: params.address,
2527
chain_name: params.chain,

0 commit comments

Comments
 (0)