Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DestinationMiddlewareFunction type is missing from export #929

Open
antgonzales opened this issue Aug 16, 2023 · 1 comment
Open

DestinationMiddlewareFunction type is missing from export #929

antgonzales opened this issue Aug 16, 2023 · 1 comment

Comments

@antgonzales
Copy link

antgonzales commented Aug 16, 2023

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:

export type DestinationMiddlewareFunction = (

@silesky
Copy link
Contributor

silesky commented Aug 16, 2023

Hey @antgonzales

We would accept a PR for this if you want to fast track it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants