Developer Hub
🔮 For applications
SDK
Data Hooks
useNavigation

Hook is used for fetch full sports navigation data with countries and leagues.

Hook represents a logic wrapper over standard Apollo's useQuery hook. Explore Apollo's docs (opens in a new tab) to understand what data the hooks return.

You can find the list of available sports here (opens in a new tab).

Usage

import { useNavigation } from '@azuro-org/sdk'
 
 
const { loading, sports } = useNavigation(props)

Props

{
  filter?: {
    sportHub?: SportHub
  }
  withGameCount?: boolean // adds the lightweight games data to sport for counting
  isLive?: boolean // if `true`, the hook will retrieve live navigation
}
enum SportHub {
  Sports = 'sports',
  Esports = 'esports',
  Unique = 'unique'
}

Return Value

{ 
  loading: boolean
  error: Error | null
  sports {
    id: string
    slug: string
    name: string
    countries {
      id: string
      slug: string
      name: string
      leagues {
        id: string
        slug: string
        name: string
        // if `withGameCount` props is true includes games data
        games {
          id: string
        }
      }
    }
  }
}