Repository navigation
Conversation
Contributor
posthog-android Compliance ReportDate: 2026-11-13 21:01:00 UTC ✅ All Tests Passed!46/46 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
Contributor
dustinbyrne
approved these changes
Nov 13, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

💡 Motivation and Context
Fixes #577
The Java server SDK has no way to read the payload of a remote config feature flag. Adds
getRemoteConfigPayload(key)toposthog-server, with the matchingflagRemoteConfigPayloadrequest method on the corePostHogApi.It sends
GET {host}/api/projects/@current/feature_flags/{key}/remote_config?token={projectToken}with the personal API key as a bearer token. No distinct id, no evaluation, no$feature_flag_calledevent, and no caching. The call blocks the calling thread for the request.The payload is parsed from JSON. A string result is parsed a second time, and stays a string when that second parse fails, same as
getRemoteConfigPayloadin posthog-node.It never throws. It returns
nullwith a warning when:personalApiKeyis set (no request is sent)., or..(no request is sent)An empty 2xx body returns
nullwith no warning. That's how the server answers a flag that has no payload, so it isn't a failure. A disabled client returnsnullwith no request.Where it differs from posthog-node:
null, because the flag methods in this SDK don't throw into the host app./,?, or#changes the request there.null. In posthog-node the call rejects.null. posthog-node throws aSyntaxErroron it today, fromawait response.json()atpackages/node/src/client.ts:2272(480395c4).The response body and the request headers aren't logged, because a remote config payload can be a decrypted secret. Both parses go through a strict
JsonReader, since the shared serializer's Gson is lenient and would accept a body likeOKas a string.The posthog.com docs change isn't part of this PR.
💚 How did you test it?
Unit tests with MockWebServer: 11 for the request method in
PostHogApiTestand 21 in the newPostHogRemoteConfigPayloadTest. They cover the request shape and key encoding, each parse result, eachnullcase with its warning, an empty 2xx body with no warning, a 404 with an empty body, and that no event is sent../gradlew :posthog:test :posthog-server:test apiCheck spotlessCheckpassed on the head commit.make apiadds the new method toposthog.apiandposthog-server.api.posthog-android.apihas no diff.I didn't test against a live PostHog instance.
📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
DRI: @ioannisj
Autonomy: Human-driven (agent-assisted)