Skip to content

Append a referrer param to the "Built with Reflex" badge link - #6951

Merged
masenf merged 4 commits into
reflex-dev:mainfrom
FarhanAliRaza:farhan/eng-11714-badge-referrer-param
Aug 27, 2026
Merged

Append a referrer param to the "Built with Reflex" badge link#6951
masenf merged 4 commits into
reflex-dev:mainfrom
FarhanAliRaza:farhan/eng-11714-badge-referrer-param

Conversation

@FarhanAliRaza

@FarhanAliRaza FarhanAliRaza commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Closes ENG-11714. Unblocks ENG-11623 (referral bonus).

What

The badge always links to reflex.dev — the destination is not freely settable. When the REFLEX_REFERRER_PARAM environment variable is set at compile time, its value is appended urlencoded:

https://reflex.dev/?ref=<urlencoded value>

Without the env var the badge link is unchanged (https://reflex.dev), so existing apps are unaffected.

Why this shape

Per discussion with @masenf: land it in the framework where the sticky badge is defined, keep the link pinned to reflex.dev, append only the param (if present), and urlencode it so special characters are not misinterpreted. The hosting service injects the per-owner referral identifier at build time via the env var — no user code changes.

Testing

Unit tests cover the default link, the appended param, urlencoding of special characters, and the empty-value fallback.

Review in cubic

@FarhanAliRaza
FarhanAliRaza requested a review from a team as a code owner August 26, 2026 19:11
@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds compile-time referral attribution to the fixed “Built with Reflex” badge URL while preserving the existing URL when no referral value is configured.

  • Defines the optional REFLEX_REFERRER_PARAM environment variable in reflex-base.
  • Percent-encodes the configured value and appends it as the badge’s ref query parameter.
  • Raises the reflex-base development dependency floor and adds focused unit coverage.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/reflex-base/src/reflex_base/environment.py Adds the optional compile-time referral environment variable used by the badge.
packages/reflex-components-core/pyproject.toml Updates the sibling-package development floor so the referenced environment attribute is available.
packages/reflex-components-core/src/reflex_components_core/core/sticky.py Builds the fixed reflex.dev badge URL with a percent-encoded referral value when configured.
tests/units/reflex_components_core/core/test_sticky.py Covers default, configured, encoded-special-character, and empty referral values.

Reviews (4): Last reviewed commit: "Update packages/reflex-components-core/p..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 5 files

Re-trigger cubic

@codspeed-hq

codspeed-hq Bot commented Aug 26, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 27 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing FarhanAliRaza:farhan/eng-11714-badge-referrer-param (d90374c) with main (ceff479)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56e8530465

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/units/reflex_components_core/core/test_sticky.py
…dge link

The badge always links to reflex.dev; when the REFLEX_REFERRER_PARAM env
var is set at compile time, its value is appended urlencoded as
https://reflex.dev/?ref=<value>. This is the mechanism the referral bonus
(ENG-11623) rides on: the hosting service injects the per-owner identifier
at build time, and the destination itself stays fixed.
@FarhanAliRaza
FarhanAliRaza force-pushed the farhan/eng-11714-badge-referrer-param branch from 56e8530 to e20d354 Compare August 27, 2026 18:14
Comment thread packages/reflex-components-core/pyproject.toml Outdated
Comment thread packages/reflex-components-core/pyproject.toml Outdated
@masenf
masenf merged commit 894cb95 into reflex-dev:main Aug 27, 2026
111 checks passed
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

Successfully merging this pull request may close these issues.

2 participants