Skip to content

docs(poppy): key a Poppy Session by its Session ID and User ID - #2959

Merged
Piyush-85 merged 4 commits into
betafrom
docs/poppy-session-key
Nov 21, 2026
Merged

Piyush-85 merged 4 commits into
betafrom
docs/poppy-session-key

Conversation

@Piyush-85

@Piyush-85 Piyush-85 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor
  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

📋 Changes

Docs only. The Poppy guide now keys a Poppy Session by act.poppy_sid + act.poppy_user_id, which is what @auth0/auth0-api-js and @auth0/auth0-server-js now use.

  • Cart example: the key is now `agent:${poppy.act.poppy_sid}|${poppy.act.poppy_user_id}`, without act.sub. The agent: prefix keeps it apart from a customer's sub, since the agent chooses both values.
  • Guest to signed in: the key stays the same when the signed-in join has the same poppy_sid and poppy_user_id as the guest's, whether the agent is linked to an Auth0 agent or not.
  • Storage paragraph:
    • act.sub and act.poppy_agent_id are data about the Session, not part of the key. For a linked agent, act.sub is the Auth0 agent's ID, not its URL.
    • Two agents that send the same Session ID and User ID share a key. The key is a name for the Session, not a secret or proof of the agent: read act.sub for that.
    • A later beta may add the agent to the key, which would change every key.

Also fixes the README's link to the Poppy guide: it pointed at main, where the guide doesn't exist yet. It is now a relative link (./guides/poppy.md), so it follows whichever branch the README is read on.

The SDK itself builds no key, so no code changes.

📎 References

🎯 Testing

N/A, docs only.

🤖 Generated with Claude Code

Change the guide's cart key from act.sub + poppy_sid + poppy_user_id to
poppy_sid + poppy_user_id, the key auth0-api-js and auth0-server-js use.
act.sub and poppy_agent_id are data about the Session, not part of the
key, since act.sub is the Auth0 agent's ID for a linked agent.

Co-Authored-By: Claude <noreply@anthropic.com>
@Piyush-85
Piyush-85 requested a review from a team as a code owner November 20, 2026 07:17
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Team
  • Run ID: d03c1562-bf6d-4dc1-87e4-95f2513123e3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@codecov-commenter

codecov-commenter commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.83%. Comparing base (db86107) to head (e586cb8).

Additional details and impacted files
@@           Coverage Diff           @@
##             beta    #2959   +/-   ##
=======================================
  Coverage   90.83%   90.83%           
=======================================
  Files          84       84           
  Lines        6468     6468           
  Branches     2321     2321           
=======================================
  Hits         5875     5875           
  Misses        528      528           
  Partials       65       65           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The guide isn't on main yet, so the README link 404s.

Co-Authored-By: Claude <noreply@anthropic.com>
Comment thread guides/poppy.md Resolved
Comment thread guides/poppy.md Resolved
Comment thread guides/poppy.md Resolved
Comment thread README.md Resolved
- Prefix the agent key with agent:, so an agent that sends auth0 and
  abc123 can't get the key of the customer auth0|abc123
- Say the key stays the same only when both poppy_sid and poppy_user_id
  are the same in the two joins
- Say the SDK can't check that a Session ID is random, and that the key
  is a name for the Session, not a secret or proof of the agent
- Link the guide from the README with a relative path

Co-Authored-By: Claude <noreply@anthropic.com>
@nandan-bhat

nandan-bhat commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Two more places still use the old rule, but they are not in this diff. Please update them in this PR too, else the guide and the code will disagree.

  1. src/types/poppy.ts: the comment of poppy_sid says to key a cart by it alone. It should say to use it together with poppy_user_id.
  2. examples/with-poppy-discovery: lib/carts.ts and app/cart/page.tsx still key the cart by act.sub and poppy_sid, and the README row for app/cart/page.tsx has the same wording. Please use the same key as the guide there.

- The poppy_sid JSDoc says to key a cart by it together with
  poppy_user_id, never alone
- The example keys its cart map by agent:<poppy_sid>|<poppy_user_id>,
  as the guide does, and shows those two on the cart page
- The example README says the same

Co-Authored-By: Claude <noreply@anthropic.com>
@Piyush-85
Piyush-85 merged commit c7d1934 into beta Nov 21, 2026
8 checks passed
@Piyush-85
Piyush-85 deleted the docs/poppy-session-key branch November 21, 2026 05:11
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.

3 participants