Initialized Vana SDK instance
The unified relayer request
Transaction and execution options
Promise resolving to operation-specific response
// In your server endpoint (Next.js example):
import { handleRelayerOperation } from '@opendatalabs/vana-sdk/node';
export async function POST(request: NextRequest) {
try {
const body = await request.json();
const vana = getServerVanaInstance(); // Your server SDK instance
// Explicit synchronous execution (Vana App model)
const result = await handleRelayerOperation(vana, body, {
execution: 'sync', // Explicit mode
syncTimeout: 45000 // 45 second timeout
});
return NextResponse.json(result);
} catch (error) {
return NextResponse.json(
{ error: error.message },
{ status: 500 }
);
}
}
Universal handler for all relayer operations.
This function processes both EIP-712 signed operations and direct operations, automatically routing to the appropriate SDK methods.