Wayfinder Core
Building for the web? Consider using @ar.io/wayfinder-react for React applications, which provides hooks and components optimized for browser environments.
Quick Start
Install
npm install @ar.io/wayfinder-core @ar.io/sdkImport and configure
import { createWayfinderClient } from '@ar.io/wayfinder-core';
const wayfinder = createWayfinderClient();Make your first request
// Use Wayfinder to fetch and verify data using ar:// protocol
const response = await wayfinder.request('ar://ardrive');
console.log(response);Use custom strategies
import { createWayfinderClient, createRoutingStrategy, createVerificationStrategy } from '@ar.io/wayfinder-core';
const customWayfinder = createWayfinderClient({
routingStrategy: createRoutingStrategy({ strategy: 'random' })
verificationStrategy: createVerificationStrategy({
strategy: 'hash',
trustedGateways: ['https://permagate.io']
})
});Enable Telemetry (Optional)
import { createWayfinderClient } from '@ar.io/wayfinder-core';
const customWayfinder = createWayfinderClient({
telemetrySettings: {
enabled: true,
sampleRate: 0.1, // 10% sampling
clientName: 'my-app',
clientVersion: '1.0.0',
}
});Next Steps
Dynamic Routing
Use Wayfinder for dynamic routing
Gateway Providers
Learn about different gateway provider strategies
Request Flow
Understanding how Wayfinder routes and verifies requests
Monitoring & Events
Monitor performance and handle events
How is this guide?