AR.IO LogoAR.IO Documentation

useWayfinderUrl

Get a dynamic URL for an existing ar:// URL or legacy arweave.net/arweave.dev URL.

Example:

import { useWayfinderUrl } from '@ar.io/wayfinder-react';

function WayfinderImage({ txId }: { txId: string }) {
  const { resolvedUrl, isLoading, error } = useWayfinderUrl({ txId });

  if (error) {
    return <p>Error resolving URL: {error.message}</p>;
  }

  if (isLoading) {
    return <p>Resolving URL...</p>;
  }

  return (
    <img src={resolvedUrl} alt={txId} />
  );
}

How is this guide?