Skip to main content

The Request Toolkit For Ultimate Efficiency

alova is perfectly compatible with your favorite HTTP clients and UI frameworks, makes ultimate efficiency in APIs integration with its business modules and devtools.

Docusaurus themed imageDocusaurus themed image
# Request StrategyBusiness development killeralova privides 20+ business modules which we call request strategy, to help you accelerate business logic development for both client-side and server-side applications.
Pagination RequestClient

Automatically manage paging data, data preloading, reduce unnecessary data refresh, improve fluency by 300%, and reduce coding difficulty by 50%

const todoList = (page, size) => alova.Get('/todos', {
params: { page, size }
});
const {
loading, data, page, pageSize, pageCount, total
} = usePagination(todoList);
Watch RequestClient

send requests immediately by watching states changes, useful in tab switching and condition quering.

useWatcher(
() => alova.Get(`/rewards/${activeKey}`),
[activeKey],
{
debounce: [500, 0]
}
)
Retry RequestServer

Using it on important requests can improve their stability.

const res = await retry(alova.Post('/api/order'), {
retry: 3,
backoff: {
delay: 1000,
multiplier: 2
}
})
Rate LimitServer

Limit the request rate within a certain period of time.

const limit = createRateLimiter({
points: 4,
duration: 60 * 1000
})
const orderRes = await limit(
alova.Get('/api/order')
)
Fetch DataClient

Preload data to display view faster, or re-fetch data across components.

const { fetching, error, fetch } = useFetcher()
fetch(alova.Get('/todo/1'))
Token authenticationClient

Global interceptor that supports silent token refresh, as well as providing unified management of token-based login, logout, token assignment and token refresh.

const { onAuthRequired, onResponseRefreshToken } = createServerTokenAuthentication({
refreshTokenOnError: {
isExpired: res => res.status === 401,
refrshTokenOnError: async () => {
const { token, refresh_token } = await refreshToken()
localStorage.setItem('token', token)
localStorage.setItem('refresh_token', refresh_token)
}
}
})
const alovaInstance = createAlova({
beforeRequest: onAuthRequired(),
responded: onResponseRefreshToken()
})
Form SubmissionClient

Automatically manage form data, it allow you implement quickly various of forms.

Auto refresh dataClient

Automatically refresh data through the events of browser, always display the newest data.

Learn total 20+ strategies
# Modern openAPI solutionMove API docs to Editoralova's devtools enable interactive communication between API information and your code, search API and view its full information while coding, all without leaving your editor.
# FlexibleRuns in any JS environment with any request toolUse hooks originated from functional components, but alova innovatively made it compatible with options and class-style UI frameworks, which means that alova's use hooks are almost not restricted by JS environments and UI frameworks, and can be used together with your familiar request tools.
Join the communityTrusted by developers around the worldOpen source projects dependent on alova
avatar
Scott HuCreator of alova

Request libs like fetch and axios make requests very simple, react-query and swr further reduce the template code of requests. But what alova aims to do is to provide extreme API consumption efficiency, eliminating almost all of your request work and achieving more efficient Client-Server data interaction.

avatar
ProddyThe author of EMS-ESP

I'm loving this library and slowly migrating my code from Axios to Alova.

avatar
0x1EC10DDeveloper

Alova is really meticulous. When I read the documents, every point was a pain point and solved many problems.

avatar
Ah jungAuthor of Naive Admin

The alovajs is nice. I plan to switch our products to alovajs uniformly

Alova teamMeet the core members
Try it NOWTake your development efficiency to the next level