Skip to content

docs: align README and addon docs with the code - #387

Merged
mosherBT merged 4 commits into
masterfrom
docs/readme-audit-fixes
Nov 12, 2026
Merged

mosherBT merged 4 commits into
masterfrom
docs/readme-audit-fixes

Conversation

@jrosendahl-opt

@jrosendahl-opt jrosendahl-opt commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Why

An audit of the README against the code found broken examples, descriptions that no longer match behaviour, references to functions that don't exist, and public features with no documentation.

What Changed

Examples that broke or misbehaved as written

  • OptableSDK.cid("id2", "c2") threw (variant must be 0–19); now cid("id2", 2).
  • Targeting examples read an undefined targeting variable; now use response and log objects instead of printing [object Object].
  • TargetingRequest type corrected to { ids, hids }, with a hashed-email example.
  • Error handlers used "${err.message}" in double quotes, so the message was never interpolated.
  • ctxSegments().then(loadGAM) passed the raw response to GAM; now passes ctxTargetingKeyValues().
  • GAM Secure Signals: { provider, id } objects passed as separate arguments (was value, in one array).
  • Prebid analytics: removed the ignored tenant option (tenant comes from node); import path now lib/dist/addons/....
  • Multi-node resolver input/return types match the code.

Descriptions corrected

  • Bot detection: removed TargetingResolvedThisSession() / MarkTargetingResolved() (they don't exist) and the claim that SkipTargetingForBots() short-circuits RTD; added a working alternative.
  • Multi-node resolver priority rules, including that user.data is merged from every rule.
  • Contextual pageview timing, context-once-per-instance, ctxSegments() caching on failure, elided example outputs.
  • readOnly, deprecated prebidORTB2(), analytics hooks, GPT listener re-calls, identifyAndTokenize edge cases, PAIR storage, OIS change-event detail, source-check timeout, demo host and prerequisites.

Newly documented

  • InitConfig: pageContext keys, consent, timeout, sessionID, skipEnrichment, additionalTargetingSignals, abTests, legacyHostCache, mockedIP, insecure.
  • npm imports needed for the GPT and tryIdentifyFromParams addons.
  • UID2 refresh, setupAB, traffic source, GAM signal-enrichment key-value, persistFlagsFromURL, and an "Other SDK methods" table.
  • Table of contents regenerated from the headings (fixes nesting, adds missing sections).

Addon docs

  • abTestAssignment.md, prebid/README.md, prebid/analytics.md: import paths now lib/dist/addons/....
  • botDetection.md: same RTD correction as the README.
  • prebid/analytics.md: initPrebidAnalytics takes your SDK instance; samplingRateFn only applies when samplingRate is between 0 and 1.

Fix examples that broke or misbehaved as written (cid variant, targeting
callbacks, TargetingRequest type, error-message interpolation, ctxSegments
-> loadGAM, GAM secure signals shape, prebid analytics tenant option and
import path, multi-node resolver types).

Correct descriptions that did not match behaviour: bot detection and RTD,
nonexistent TargetingResolvedThisSession/MarkTargetingResolved, multi-node
priority rules, contextual pageview timing, readOnly, deprecated
prebidORTB2, analytics hooks, identifyAndTokenize edge cases, OIS change
event detail, source-check timeout, demo host and prerequisites.

Document previously undocumented InitConfig options, npm addon imports,
UID2 refresh, setupAB, traffic source, GAM signal enrichment and other SDK
methods, and regenerate the table of contents. Fix import paths and
claims in the addon docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jrosendahl-opt
jrosendahl-opt requested review from a team as code owners November 11, 2026 17:09
jrosendahl-opt and others added 2 commits November 11, 2026 11:29
The examples used !!sessionStorage.optableDebug, which is true for
?optableDebug=0 because flag values are strings. Use flagEnabled() and
reword the Debugging note to point at the QA flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jplaroche jplaroche 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

@mosherBT
mosherBT merged commit 29d9074 into master Nov 12, 2026
7 checks passed
@mosherBT
mosherBT deleted the docs/readme-audit-fixes branch November 12, 2026 19:01
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