Modular HTTP extensions for Angular.
Enriching HTTP clients with capabilities related to security, performance or resilience is a common need but it is also an error-prone and sometimes complex task.
Convoyr has been built with one goal in mind: helping you focus on your apps' features instead of the transport layer's boilerplate and matters... and without any trade-off.
yarn add @convoyr/core @convoyr/angular # or npm install @convoyr/core @convoyr/angular
yarn add @convoyr/plugin-cache @convoyr/plugin-retry # or npm install @convoyr/plugin-cache @convoyr/plugin-retry
import { ConvoyrModule } from '@convoyr/angular';
import { createCachePlugin } from '@convoyr/plugin-cache';
import { createRetryPlugin } from '@convoyr/plugin-retry';
@NgModule({
imports: [
ConvoyrModule.forRoot({
plugins: [
createCachePlugin(), // enable caching of all GET requests (Cf. @convoyr/plugin-cache)
createRetryPlugin(), // automatically retry failed requests (Cf. @convoyr/plugin-retry)
],
}),
]
})
export class AppModule {}
The main building block is the plugin. A plugin is a simple object that lets you intercept network communications and control or transform them easily. Like an HttpInterceptor
a plugin may transform outgoing request and the response stream as well before passing it to the next plugin.
Convoyr comes with its built-in plugin collection to provide useful features to your apps and to tackle the need to rewrite redundant logic between projects.
This project is a monorepo that includes the following packages.
Package | Name | Description |
---|---|---|
@convoyr/plugin-auth | Auth plugin | Handle authentication |
@convoyr/plugin-cache | Cache plugin | Respond with cached results first then with fresh data when ready |
@convoyr/plugin-retry | Retry plugin | Retry failed requests with exponential backoff |
Follow the guide to create your own custom plugins.
Here is a list of useful resources related to Convoyr.
For incoming evolutions see our board.
For new features or breaking changes see the changelog.
See our contributing guide before starting. Contributions of any kind welcome!
This project follows the all-contributors specification.
Younes Jaaidi 🐛 💻 📖 💡 🤔 |
Edouard Bozon 🐛 💻 📖 💡 🤔 |
Pierre-Edouard Galtier 📖 |
This project is MIT licensed.
Version | Tag | Published |
---|---|---|
4.0.0 | latest | 2yrs ago |