Skip to main content

Workflow-Streamlined

Next Generation Request Tool

Extremely streamline API integration workflow. Just one step

Docusaurus themed imageDocusaurus themed image
More modern openAPI solutionDiscard the intermediary API docsalova's devtools can generate API calling code, as well as TypeScript types and detailed documentation for each API. Even in JavaScript projects, you can enjoy full TypeScript type hinting. Moreover, you can quickly search for the APIs you need, match parameters from the parameter list, all without leaving your editor.
Request StrategyComplex request scenes killerWith alova's client and server request strategies, you can handle requests across diverse scenarios. Each scenario is equipped with comprehensive stateful parameters, events, and actions, allowing complex requests to be executed with just a single line of code.
Pagination RequestClient

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

usePagination((page, size) => totoList(page, size), {
initialData: {
total: 0,
data: []
},
initialPage: 1,
initialPageSize: 10
})
Watch RequestClient

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

useWatcher(
() => filterTodoList(page, keyword),
[keyword, page],
{
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(getTodoDetail)
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
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