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

feat: add headers support for mixpanel proxy api calls #833

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

abhilashdas-cred
Copy link
Contributor

@abhilashdas-cred abhilashdas-cred commented Mar 27, 2024

Introducing Header Support for Mixpanel Proxy Servers

This pull request introduces a feature enabling proxy servers to request custom headers from the application.

Problem:

Currently, when the proxy server URL is set, it makes API calls in a standard manner. However, if the application wishes to include certain headers, such as authentication tokens or device IDs, this isn't possible.

Solution:

This pull request implements a callback mechanism. Before making an API call, the system requests headers and returns the API endpoint and status code. This information can be utilized by the application for tracking or other purposes.

Implementation:

This implementation introduces a new property in the config class called "MixpanelServerCallback". It contains a method named "getHeaders()" which requests any headers to be passed just before the proxy server API call. Once the API call is complete, it returns the API endpoint and status code via "onResponse()".

Benefits:

Enhanced Proxy API Control:
This solution grants the proxy API full control during Mixpanel proxy API calls.

@zihejia zihejia self-requested a review March 29, 2024 00:28
Copy link
Collaborator

@zihejia zihejia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zihejia zihejia merged commit a3fdf69 into mixpanel:master Apr 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants