[]
Configuration options for handling external resources required by X.509 validation and related PDF security features.
This API provides hooks to fully control:
optional afterResponse?: (resource, responseData) => void;
Hook invoked after a successful resource response is received.
Provides access to both the request context and raw response data, useful for caching, inspection, or telemetry.
ArrayBuffer
void
optional beforeRequest?: (resource) => void;
Hook invoked immediately before a resource request is executed.
Can be used for:
void
optional loader?: ResourceLoader;
Custom resource loader implementation.
If not provided, the library will use a default loader based on the current runtime environment (browser or Node.js).
optional onError?: (resource, err) => void;
Hook invoked when a resource request fails.
Useful for:
unknown
void
optional resolveUrl?: (ctx) => string | Promise<string>;
Optional URL resolver that allows rewriting or proxying external resource URLs before they are fetched.
This is especially useful in browser environments where CORS restrictions prevent direct access to certificate-related endpoints.
string | Promise<string>