Home > @uniformdev/context

context package

Classes

Class

Description

Context

CookieTransitionDataStore

Handles 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 Class

Description

TransitionDataStore

Enumerations

Enumeration

Description

ScriptType

Functions

Function

Description

areCommandsEqual(a, b)

computeAggregateDimensions(primitiveScores, aggregates)

Computes aggregated scores based on other dimensions

createConsoleLogDrain(level)

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.

NOTE: you probably want enableConsoleLogDrain() instead of this function.

createDebugConsoleLogDrain(level, options)

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.

NOTE: you probably want enableDebugConsoleLogDrain() instead of this function.

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, quirks)

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(options)

serializeCookie(data)

serializeCookieType(type)

serializePersonalizeVariants({ personalizeVariants, }, input)

serializeQuickConnect(config)

serializeQuirks(quirks)

strongestScorePersonalizationSelectionAlgorithm({ name, context, variations, take, onLogMessage, }, input)

Implementation of the strongest score personalization selection algorithm.

In this mode, we take all variations and break them into two groups: 1. Variations that have a positive score for their tagged dimension 2. Variations that do not have a dimension tag

We then sort the first group by score, concatenate the second group, and return the top variations.

testVariations({ name, context, variations, onLogMessage, }, input)

topDownCriteriaPersonalizationSelectionAlgorithm({ name, context, variations, take, onLogMessage, }, input)

Implementation of the top-down criteria personalization selection algorithm.

In this mode, we evaluate variations in the order they are declared and the first variations whose criteria evaluate to true are selected.

Interfaces

Interface

Description

ContextInstance

ContextOptions

PersonalizationSelectionAlgorithmOptions

PersonalizeOptions

VariantMatchCriteria

Data for a personalization variation using the top-down criteria selection algorithm

VariationMatchDimensionCriteria

Data for a personalization variation using the TODO selection algorithm

VariationMatchMetadata

Data that must exist on a personalization variation regardless of selection algorithm

Variables

Variable

Description

CONTEXTUAL_EDITING_TEST_NAME

CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID

cookieEvaluator

currentPageEvaluator

EdgeNodeTagName

ENR_SEPARATOR

eventEvaluator

KV_SEP

pageViewCountDimension

pageViewCountEvaluator

PAIR_SEP

queryStringEvaluator

QUIRK_SEP

quirkEvaluator

SERVER_STATE_ID

STRONGEST_SCORE_PERSONALIZATION_ALGORITHM

TOP_DOWN_CRITERIA_PERSONALIZATION_ALGORITHM

TYPE_SEP

UNIFORM_DEFAULT_COOKIE_NAME

UNIFORM_DEFAULT_QUIRK_COOKIE_NAME

Type Aliases

Type Alias

Description

AggregateDimension

AggregateDimensionInput

BehaviorTag

Content that is tagged for adding enrichment score when triggered by behavior (i.e. being shown that content)

CompositionMetadata

Canvas-specific data that should be managed separately from regular context updates

ConsoleDebugLogDrainOptions

ContextDevToolOptions

ContextEvents

ContextPlugin

Defines a plugin for Uniform Context. The plugin should attach event handlers in its creation function.

ContextState

Expresses a 'patch' to the Uniform Context state

ContextStateUpdate

CookieTransitionDataStoreOptions

CriteriaEvaluator

A type that evaluates a signal criteria type and decides if it matches the current Context state or not.

CriteriaEvaluatorParameters

CriteriaEvaluatorResult

The result of evaluating a signal criteria.

DecayFunction

Computes 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

DevToolsActions

Mutations the DevTools can take on the data it receives

DevToolsDataEvent

Emitted when data is updated in Context to the devtools

DevToolsEvent

DevToolsEvents

DevToolsForgetEvent

A request to forget me from the DevTools

DevToolsHelloEvent

A hello message emitted as an event from the browser extension to test if the page contains Context

DevToolsLogEvent

A log message emitted as an event to the browser extension

DevToolsRawCommandsEvent

Devtools requests a raw update cycle (explicitly set scores of dimensions in durations, etc)

DevToolsState

The data state provided to the devtools for rendering.

DevToolsUiVersion

The version of the DevTools UI to load when in Chromium extension context. 1: Uniform Optimize. 2: Uniform Context.

DevToolsUpdateEvent

Devtools requests a normal update cycle (regular data update, re-eval signals, etc)

DimensionMatch

EdgePersonalizeComponentOptions

EdgeTestComponentOptions

EdgeTransitionDataStoreOptions

EnableUniformInsightsOptions

EnrichmentCategory

EnrichmentData

EventData

An event that has occurred (i.e. an analytics track) which may trigger an Event signal

Goals

GoalStateUpdate

IdentifyCommand

Identifies 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

LogMessages

Defines all error codes and their parameter(s)

LogMessageSingle

ManifestV2

MessageCategory

MessageFunc

ModifyScoreCommand

Changes the visitor's permanent score for a given dimension

ModifySessionScoreCommand

Changes the visitor's session (time-based) score for a given dimension

NumberMatch

OutputSeverity

PersonalizationEvent

Emitted when a personalization runs

PersonalizationEventVariantId

PersonalizationManifest

PersonalizationSelectionAlgorithm

PersonalizationSelectionAlgorithms

PersonalizeControlVariant

PersonalizedResult

The result of computing personalized content from variations

PersonalizedVariant

Defines the shape of a personalized content variant

PersonalizeVariants

QuickConnectConfig

QuirkMatch

Quirks

ScoreVector

ServerToClientTransitionState

SetConsentCommand

Changes 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.

SetControlGroupCommand

Sets 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.

SetGoalCommand

Converts the goal specified.

SetPersonalizeVariantControlCommand

SetQuirkCommand

Sets a permanent quirk key and value for the visitor

SetTestCommand

Sets a specific variant as being this visitor's variant on an A/B test

Severity

Signal

SignalCriteria

SignalCriteriaGroup

SignalData

StorageCommand

StorageCommands

Commands that can be issued to alter the storage of Uniform Context data

StringMatch

TestDefinition

TestEvent

Emitted event when an A/B test runs

TestOptions

TestResult

The result of computing an A/B test result

Tests

TestVariant

Defines the shape of a A/B test variant

TransitionDataStoreEvents

TransitionDataStoreOptions

VisitorData

VisitorDataStoreEvents

VisitorDataStoreOptions