React Hooks

The @actioncodes/sdk/react module provides convenient hooks for consuming Action Codes in React applications.

📥 useActionCode(code)

Resolves and decrypts metadata associated with an Action Code. Automatically fetches on mount and when code changes.

const { action, intendedFor, loading, error, refetch } = useActionCode(code);

Returned Fields

FieldDescription
actionPartial metadata like label, message, references
intendedForWallet that is authorized to use this code
loadingBoolean loading state
errorError object if resolution fails
refetchFunction to manually re-run the resolution

🚀 useSubmitAction()

Submits an Action Code and tracks its live status. Useful for executing a transaction or triggering a one-time intent.

const { submit, status, loading, error, reset } = useSubmitAction();

Returned Fields

FieldDescription
submit(code, fields)Starts submission and status tracking
statusLatest status string (e.g. 'pending', 'ready')
loadingBoolean loading state
errorError object if the action fails
reset()Clears state for reuse
Logo

Action Codes

Fast, trusted transactions using human-readable codes.

      Resources