Home > @uniformdev/context

context package

Classes

ClassDescription
Context
CookieTransitionDataStoreHandles client-to-server score handoff using an encoded cookie with the visitor score vector. NOTE: forget me is not supported when on the server side.
EdgeTransitionDataStore
GroupCriteriaEvaluator
ManifestInstance
VisitorDataStore

Abstract Classes

Abstract ClassDescription
TransitionDataStore

Enumerations

EnumerationDescription
ScriptType

Functions

FunctionDescription
areCommandsEqual(a, b)
computeAggregateDimensions(primitiveScores, aggregates)Computes aggregated scores based on other dimensions
createConsoleLogDrain(level)<p>Creates a new log drain that will log to the console. The log drain will only log event IDs, but is much smaller than the debug log drain.</p><p>NOTE: you probably want enableConsoleLogDrain() instead of this function.</p>
createDebugConsoleLogDrain(level, options)<p>Creates a new log drain that will log full debug messages to the console. The debug log drain adds significant bundle size, but is useful for debugging.</p><p>NOTE: you probably want enableDebugConsoleLogDrain() instead of this function.</p>
createLinearDecay(options)Creates a function that applies linear decay to scores over time.
decodeCookieType(type)
decodePersonalizeVariants(data)
emptyVisitorData()
enableConsoleLogDrain(level)Enables logging Context events to the browser console. Lightweight events with only the event ID are emitted.
enableContextDevTools(options)Enables a Context instance to feed data to the Uniform Context DevTools. DevTools can be hosted either as a Chromium extension, or as a standalone React app within a page and receive data once this plugin has been activated.
enableDebugConsoleLogDrain(level, options)Enables logging Context events to the browser console. Lightweight events with only the event ID are emitted.
enableUniformInsights(options)
encodeCookieType(type)
evaluateVariantMatch(variantId, match, vec, onLogMessage)
explainStringMatch(lhs, match)
explainStringMatchCriteria(match)
getEnrichmentVectorKey(category, value)
isStringMatch(lhs, match)Tests if a StringMatch matches a string value
parseCookieScores(type)
parseCookieType(type)
parseQuickConnect(serialized)
parseQuirkCookie(quirkCookieValue)
parseScoreCookie(cookieValue, quirkCookieValue)
personalizeVariations({ name, context, variations, take, onLogMessage, })
serializeCookie(data)
serializeCookieType(type)
serializePersonalizeVariants({ personalizeVariants, })
serializeQuickConnect(config)
serializeQuirks(quirks)
testVariations({ name, context, variations, onLogMessage, })

Interfaces

InterfaceDescription
ContextInstance

Variables

VariableDescription
CONTEXTUAL_EDITING_TEST_NAME
CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID
cookieEvaluator
currentPageEvaluator
EdgeNodeTagName
eventEvaluator
KV_SEP
pageViewCountDimension
pageViewCountEvaluator
PAIR_SEP
queryStringEvaluator
QUIRK_SEP
quirkEvaluator
SERVER_STATE_ID
TYPE_SEP
UNIFORM_DEFAULT_COOKIE_NAME
UNIFORM_DEFAULT_QUIRK_COOKIE_NAME

Type Aliases

Type AliasDescription
AggregateDimension
AggregateDimensionInput
BehaviorTagContent that is tagged for adding enrichment score when triggered by behavior (i.e. being shown that content)
ConsoleDebugLogDrainOptions
ContextDevToolOptions
ContextEvents
ContextOptions
ContextPluginDefines a plugin for Uniform Context. The plugin should attach event handlers in its creation function.
ContextStateExpresses a 'patch' to the Uniform Context state
ContextStateUpdate
CookieTransitionDataStoreOptions
CriteriaEvaluatorA type that evaluates a signal criteria type and decides if it matches the current Context state or not.
CriteriaEvaluatorParameters
CriteriaEvaluatorResultThe result of evaluating a signal criteria.
DecayFunctionComputes decay of visitor scores over time. NOTE: it is expected that this function mutates the incoming score vectors, if it needs to apply score decay. The data store ensures immutability already.
DecayOptions
DevToolsActionsMutations the DevTools can take on the data it receives
DevToolsDataEventEmitted when data is updated in Context to the devtools
DevToolsEvent
DevToolsEvents
DevToolsForgetEventA request to forget me from the DevTools
DevToolsHelloEventA hello message emitted as an event from the browser extension to test if the page contains Context
DevToolsLogEventA log message emitted as an event to the browser extension
DevToolsRawCommandsEventDevtools requests a raw update cycle (explicitly set scores of dimensions in durations, etc)
DevToolsStateThe data state provided to the devtools for rendering.
DevToolsUiVersionThe version of the DevTools UI to load when in Chromium extension context. 1: Uniform Optimize. 2: Uniform Context.
DevToolsUpdateEventDevtools requests a normal update cycle (regular data update, re-eval signals, etc)
DimensionMatch
EdgePersonalizeComponentOptions
EdgeTestComponentOptions
EdgeTransitionDataStoreOptions
EnableUniformInsightsOptions
EnrichmentCategory
EnrichmentData
EventDataAn event that has occurred (i.e. an analytics track) which may trigger an Event signal
Goals
GoalStateUpdate
IdentifyCommandIdentifies the visitor as being a specific unique identifier. NOTE: this only has an effect when using an external cross-device transition storage system. NOTE: you cannot read the identified visitor ID back from the storage system once it is set.
LinearDecayOptions
LogDrain
LogMessage
LogMessageGroup
LogMessagesDefines all error codes and their parameter(s)
LogMessageSingle
ManifestV2
MessageCategory
MessageFunc
ModifyScoreCommandChanges the visitor's permanent score for a given dimension
ModifySessionScoreCommandChanges the visitor's session (time-based) score for a given dimension
NumberMatch
OutputSeverity
PersonalizationEventEmitted when a personalization runs
PersonalizationManifest
PersonalizeControlVariant
PersonalizedResultThe result of computing personalized content from variations
PersonalizedVariantDefines the shape of a personalized content variant
PersonalizeOptions
PersonalizeVariants
QuickConnectConfig
Quirks
ScoreVector
ServerToClientTransitionState
SetConsentCommandChanges the visitor's storage consent setting. Setting consent to false will trigger deletion of any stored data for the visitor. Scores are still collected in-memory when consent is false; just not persisted.
SetControlGroupCommandSets whether the current visitor is in the personalization control group (Will not be exposed to personalization or gather classification data; WILL see A/B tests) In most cases this should not be sent as the membership is computed automatically for visitors; this command is intended mostly for diagnostics and testing purposes.
SetGoalCommandConverts the goal specified.
SetPersonalizeVariantControlCommand
SetQuirkCommandSets a permanent quirk key and value for the visitor
SetTestCommandSets a specific variant as being this visitor's variant on an A/B test
Severity
Signal
SignalCriteria
SignalCriteriaGroup
SignalData
StorageCommand
StorageCommandsCommands that can be issued to alter the storage of Uniform Context data
StringMatch
TestDefinition
TestEventEmitted event when an A/B test runs
TestOptions
TestResultThe result of computing an A/B test result
Tests
TestVariantDefines the shape of a A/B test variant
TransitionDataStoreEvents
TransitionDataStoreOptions
VariantMatchCriteria
VisitorData
VisitorDataStoreEvents
VisitorDataStoreOptions