analytics-next
analytics-next copied to clipboard
DestinationMiddlewareFunction type is missing from export
I'm currently trying to create a Destination Middleware Function outlined in this guide: https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/middleware/
The current @segment/analytics-next library supports importing the general MiddlewareFunction
type but does not support DestinationMiddlewareFunction
.
Here's how I want to use the type:
import type { DestinationMiddlewareFunction } from '@segment/analytics-next';
export function destinationMiddlewareFactory(): DestinationMiddlewareFunction {
return function destinationMiddlware({payload, integration, next}) {
...
next(payload)
}
}
I'm currently using "@segment/analytics-next": "^1.53.3".
Here is the type in the sourcecode: https://github.com/segmentio/analytics-next/blob/9ba0dc6fc1fb237bbed72da458d0c4ea80d52cd8/packages/browser/src/plugins/middleware/index.ts#L23
Hey @antgonzales
We would accept a PR for this if you want to fast track it.