Skip to content

Optional Features

APIHive has some optional features that were made available as separate modules to reduce the bundle size of the core library.

Features

Feature NameDescription
upload-progressAdds support for tracking upload progress
download-progressAdds support for tracking download progress
request-hashAdds support for generating a hash for the request
adaptersAdds support for adapters
sse-requestAdds support for Server-Sent Events
retryAdds support for retrying requests

How to enable features

To enable a feature, import the feature class from @apihive/core/features/[feature-name] and call use(new FeatureClass()) on the factory instance.

ts
import { HTTPRequestFactory } from '@apihive/core';
import { UploadProgressFeature } from '@apihive/core/features/upload-progress';

const factory = new HTTPRequestFactory()
    .use(new UploadProgressFeature());