amplitude / amplitude/Amplitude-TypeScript

Ampli DestinationPlugin doesn't support undefined return value

未关闭
#308 9 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
documentation
主要语言
TypeScript
星标
180
派生
68
平均合并
3 天 1 小时
30 天内合并 PR
29

描述

Hello,

There's a discrepancy between the docs and the implementation of the Ampli Plugin.

I'm trying to write a plugin to forward data to other services and in some cases not to Amplitude, just like [this middleware from the docs](https://www.docs.developers.amplitude.com/data/ampli/middleware/#forward-data-to-other-services-but-not-amplitude).

## Expected Behavior
According to the [docs](https://www.docs.developers.amplitude.com/data/ampli/plugin/#forward-data-to-other-services-but-not-amplitude):
> if used as a destination type plugin, the expected return value is undefined

## Current Behavior

This is not the case in the code: https://github.com/amplitude/Amplitude-TypeScript/blob/main/packages/analytics-types/src/plugin.ts#L25

## Possible Solution

Update docs / change type to allow DestinationPlugins to return undefined

## Environment
- JS SDK Version: 1.6.7
- Installation Method: yarn
- Browser and Version: Brave v1.46.153

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。