Skip to content

INTER-2456: Support tags option and deprecate tag - #216

Open
kevinmia wants to merge 2 commits into
mainfrom
chore/INTER-2456-standardize-tags
Open

kevinmia wants to merge 2 commits into
mainfrom
chore/INTER-2456-standardize-tags

Conversation

@kevinmia

@kevinmia kevinmia commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

First PR as a part of INTER-2456. We're looking to standardize usage of tags across SDKs. We will ensure that tag keeps working, and tags wins if both are passed.

The lockfile change is pretty large, but the only change from this PR is @fingerprint/agent 4.1.2 → 4.1.6. The rest is explained in the PR description in #214. Whichever of the two merges second will need to regenerate the lockfile.

Changes:

  • Require @fingerprint/agent 4.1.6 or later so tags is in GetOptions
  • Add tags to the options cache key. Without it, changing tags didn't trigger a new request and calls with different tags were deduplicated
  • Update the README and create-react-app example to use tags, with a note that tag is deprecated

Testing:

  • Added tests for the cache key fix. Changing tags triggers a new request, and calls with different tags aren't deduplicated. Both failed before the fix
  • Existing tag tests still pass
  • Built the create-react-app, next and next-appDir examples locally

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

St.❔
Category Percentage Covered / Total
🟢 Statements 96.79% 151/156
🟢 Branches 95.51% 85/89
🟢 Functions 97.78% 44/45
🟢 Lines 97.33% 146/150

Test suite run success

43 tests passing in 15 suites.

Report generated by 🧪jest coverage report action from 18361f6

Show full coverage report
St File % Stmts % Branch % Funcs % Lines Uncovered Line #s
🟢 All files 96.79 95.5 97.77 97.33
🟢  src 100 100 100 100
🟢   detect-env.ts 100 100 100 100
🟢   env.types.ts 100 100 100 100
🟢   ...nt-context.ts 100 100 100 100
🟢   ssr.ts 100 100 100 100
🟢   ...sitor-data.ts 100 100 100 100
🟢  src/components 100 100 100 100
🟢   ...-provider.tsx 100 100 100 100
🟢   ...vironment.tsx 100 100 100 100
🟢  src/utils 88.09 87.5 92.3 90
🟢   ...is-defined.ts 100 100 100 100
🟢   ...-cache-key.ts 80.76 83.33 85.71 84 5,10,43,52
🟢   to-error.ts 100 100 100 100
🟢   ...mise-store.ts 100 100 100 100

Copilot AI 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.

🔵 Needs a closer look

The supplied changes have no identified blocking issues, but the large lockfile change described in the PR remains unreviewed.

No open issues 🎉

What changed in this PR

This PR adds tags support to the React SDK while preserving the deprecated tag option, aligning the SDK with the agent’s tagging API.

Changes:

  • Include tags in cache keys, with regression tests for request deduplication and automatic refetching.
  • Require @fingerprint/agent version ^4.1.6.
  • Update documentation and the sign-in example to use tags, and add a minor-release changeset.
File Description
src/​utils/​get-options-cache-key.ts Include tags in request cache keys.
README.md Document tags, legacy tag support, and precedence.
package.json Raise the minimum agent version to 4.1.6.
examples/​create-react-app/​src/​shared/​pages/​SignInPage.tsx Switch the sign-in form to tags.
.changeset/​tags-option-support.md Record the feature for a minor release.
__tests__/​use-visitor-data.test.tsx Test deduplication and refetching with different tags.

Review effort: Balanced

TheUnderScorer
TheUnderScorer previously approved these changes Oct 23, 2026

@TheUnderScorer TheUnderScorer 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.

LGTM, left just one suggestion, thanks!

Comment thread .changeset/tags-option-support.md Outdated
'@fingerprint/react': minor
---

Support `tags` in `useVisitorData` and deprecate `tag`. Bump `@fingerprint/agent` dependency to `^4.1.6`.

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.

nit: for clarity, consider moving "Bump @fingerprint/agent dependency to ^4.1.6." note to a separate changeset

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the call out! Updated here: #216 (comment)

JuroUhlar
JuroUhlar previously approved these changes Oct 23, 2026
@kevinmia
kevinmia dismissed stale reviews from JuroUhlar and TheUnderScorer via 18361f6 October 23, 2026 16:21
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Following releases will be created using changesets from this PR:

@fingerprint/react@3.3.0

Minor Changes

  • Support tags in useVisitorData and deprecate tag (f8764cb)

Patch Changes

  • Bump @fingerprint/agent dependency to ^4.1.6 (18361f6)

This branch has not been deployed

No deployments
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.

4 participants