Options
All
  • Public
  • Public/Protected
  • All
Menu

@sajari/sdk-js

Index

Type aliases

Aggregates

Aggregates: Record<string, Record<string, CountAggregate | MetricAggregate>>

ClickToken

ClickToken: { click: string }

ClickToken defines a click token. See TrackingType.Click for more details.

Type declaration

  • click: string

ConfigObj

ConfigObj: { clickTokenURL: string; userAgent: string }

Type declaration

  • clickTokenURL: string

    Redirect URL for click tracking. Prepended to the the front of the token returned by the engine.

  • userAgent: string

    Callers can set this to add an additional user agent value to the request's metadata.

FilterFunc

FilterFunc: () => string

Type declaration

    • (): string
    • Returns string

MetricAggregate

MetricAggregate: number

PosNegToken

PosNegToken: { neg: string; pos: string }

PosNegToken defines a pos/neg token pair. See TrackingType.PosNeg for more details.

Type declaration

  • neg: string
  • pos: string

SubCallback

SubCallback: (...data: any) => void

Type declaration

    • (...data: any): void
    • Parameters

      • Rest ...data: any

      Returns void

Token

TokenState

TokenState: { clickSubmitted: boolean; token: PosNegToken }

Type declaration

Tracking

Tracking: { data?: Record<string, string>; field?: undefined | string; queryID?: undefined | string; sequence?: undefined | number; type: TrackingType }

Tracking defines behaviour for handling search sessions and result interactions.

Type declaration

  • Optional data?: Record<string, string>
  • Optional field?: undefined | string
  • Optional queryID?: undefined | string
  • Optional sequence?: undefined | number
  • type: TrackingType

UnSubFn

UnSubFn: () => void

Type declaration

    • (): void
    • Returns void

ValueFunc

ValueFunc: () => string

Type declaration

    • (): string
    • Returns string

ValueType

ValueType: string | number | boolean | string[] | number[] | boolean[] | ValueFunc

Variables

Const EVENT_OPTIONS_UPDATED

EVENT_OPTIONS_UPDATED: "options-updated" = "options-updated"

Const EVENT_SEARCH_SENT

EVENT_SEARCH_SENT: "search-sent" = "search-sent"

Const EVENT_SELECTION_UPDATED

EVENT_SELECTION_UPDATED: "selection-updated" = "selection-updated"

Const EVENT_TRACKING_RESET

EVENT_TRACKING_RESET: "tracking-reset" = "tracking-reset"

Const EVENT_VALUES_UPDATED

EVENT_VALUES_UPDATED: "values-changed" = "values-changed"

Const POS_NEG_STORAGE_KEY

POS_NEG_STORAGE_KEY: "sajari_tokens" = "sajari_tokens"

Const scriptTag

scriptTag: undefined | null | string = !isSSR()? (document.currentScript as HTMLScriptElement | null)?.src: null

Let suffix

suffix: string = ""

Functions

Const getItem

  • getItem(key: string): string | null
  • Parameters

    • key: string

    Returns string | null

Const isSSR

  • isSSR(): boolean
  • Check if we're in a server-side rendering context

    Returns boolean

Const setItem

  • setItem(key: string, value: string): void
  • Parameters

    • key: string
    • value: string

    Returns void

Object literals

Const configDefaults

configDefaults: object

clickTokenURL

clickTokenURL: string = "https://re.sajari.com/token/"

userAgent

userAgent: string = ""

Generated using TypeDoc