airbridge-web-sdk
    Preparing search index...

    Interface WebEvent

    interface WebEvent {
        send(category: string): void;
        send(category: string, options: EventOptions): void;
        wait(timeout: number, callback: (error: Error) => void): void;
        homeViewEvent(): void;
        signIn(options?: SignOptions & EventOptions): void;
        signUp(options?: SignOptions & EventOptions): void;
        signOut(options?: EventOptions): void;
        searchResultViewEvent(
            options?: SearchResultViewOptions & EventOptions,
        ): void;
        productListViewEvent(options?: ProductListViewOptions & EventOptions): void;
        productDetailsViewEvent(
            options?: ProductDetailsViewOptions & EventOptions,
        ): void;
        addedToCart(options?: AddedToCartOptions & EventOptions): void;
        purchased(options?: PurchasedOptions & EventOptions): void;
    }
    Index

    Methods

    • Sends the web event.

      Parameters

      • category: string

        The category to send the web event.

      Returns void

      airbridge.events.send('category')
      
    • Sends the web event with the options.

      Parameters

      • category: string

        The category to send the web event.

      • options: EventOptions

        The options to send the web event.

        • Optionalaction?: string
        • Optionallabel?: string
        • Optionalvalue?: number
        • OptionalsemanticAttributes?: {
              query?: string;
              productListID?: string;
              cartID?: string;
              transactionID?: string;
              inAppPurchased?: boolean;
              currency?: string;
              totalValue?: number;
              products?: {
                  productID?: string;
                  name?: string;
                  price?: number;
                  currency?: string;
                  quantity?: number;
                  position?: number;
              }[];
              [key: string]: unknown;
          }

          The semantic attributes to send the web event defined by Airbridge.

        • OptionalcustomAttributes?: Record<string, string>

          The custom attributes to send the web event.

      Returns void

      airbridge.events.send('category', {
      action: 'action',
      label: 'label',
      value: 100,
      semanticAttributes: {
      query: 'query',
      },
      customAttributes: {
      key: 'value',
      },
      })
    • Waits for the web event to be sent.

      Parameters

      • timeout: number

        The timeout (milliseconds) to wait for the web event to be sent.

      • callback: (error: Error) => void

      Returns void

      airbridge.events.wait(1000, (error) => {
      if (error) {
      // Handle the error
      console.error('Error:', error)
      return
      }
      // Event sent successfully
      // Do something after the event is sent
      console.log('Event sent successfully')
      })
    • Sends the web event for the home view event.

      Returns void

      Use airbridge.events.send() instead.

      airbridge.events.send('airbridge.ecommerce.home.viewed')
      
    • Sends the web event for the sign in event.

      Parameters

      • Optionaloptions: SignOptions & EventOptions

        The options to send the web event.

        • OptionaluserID?: string
        • OptionaluserEmail?: string
        • OptionaluserPhone?: string
        • Optionalattributes?: Record<string, unknown>
        • Optionalalias?: Record<string, string>
        • Optionalaction?: string
        • Optionallabel?: string
        • Optionalvalue?: number
        • OptionalsemanticAttributes?: {
              query?: string;
              productListID?: string;
              cartID?: string;
              transactionID?: string;
              inAppPurchased?: boolean;
              currency?: string;
              totalValue?: number;
              products?: {
                  productID?: string;
                  name?: string;
                  price?: number;
                  currency?: string;
                  quantity?: number;
                  position?: number;
              }[];
              [key: string]: unknown;
          }

          The semantic attributes to send the web event defined by Airbridge.

        • OptionalcustomAttributes?: Record<string, string>

          The custom attributes to send the web event.

      Returns void

      Use airbridge.events.send() instead.

      airbridge.events.send('airbridge.user.signin', { ... })
      
    • Sends the web event for the sign up event.

      Parameters

      • Optionaloptions: SignOptions & EventOptions

        The options to send the web event.

        • OptionaluserID?: string
        • OptionaluserEmail?: string
        • OptionaluserPhone?: string
        • Optionalattributes?: Record<string, unknown>
        • Optionalalias?: Record<string, string>

      Returns void

      Use airbridge.events.send() instead.

      airbridge.events.send('airbridge.user.signup', { ... })
      
    • Sends the web event for the sign out event.

      Parameters

      • Optionaloptions: EventOptions

        The options to send the web event.

        • Optionalaction?: string
        • Optionallabel?: string
        • Optionalvalue?: number
        • OptionalsemanticAttributes?: {
              query?: string;
              productListID?: string;
              cartID?: string;
              transactionID?: string;
              inAppPurchased?: boolean;
              currency?: string;
              totalValue?: number;
              products?: {
                  productID?: string;
                  name?: string;
                  price?: number;
                  currency?: string;
                  quantity?: number;
                  position?: number;
              }[];
              [key: string]: unknown;
          }

          The semantic attributes to send the web event defined by Airbridge.

        • OptionalcustomAttributes?: Record<string, string>

          The custom attributes to send the web event.

      Returns void

      Use airbridge.events.send() instead.

      airbridge.events.send('airbridge.user.signout', { ... })
      
    • Sends the web event for the search result view event.

      Parameters

      • Optionaloptions: SearchResultViewOptions & EventOptions

        The options to send the web event.

        • Optionalquery?: string
        • Optionalproducts?: Product[]
        • Optionalaction?: string
        • Optionallabel?: string
        • Optionalvalue?: number
        • OptionalsemanticAttributes?: {
              query?: string;
              productListID?: string;
              cartID?: string;
              transactionID?: string;
              inAppPurchased?: boolean;
              currency?: string;
              totalValue?: number;
              products?: {
                  productID?: string;
                  name?: string;
                  price?: number;
                  currency?: string;
                  quantity?: number;
                  position?: number;
              }[];
              [key: string]: unknown;
          }

          The semantic attributes to send the web event defined by Airbridge.

        • OptionalcustomAttributes?: Record<string, string>

          The custom attributes to send the web event.

      Returns void

      Use airbridge.events.send() instead.

      airbridge.events.send('airbridge.ecommerce.searchResults.viewed', { ... })
      
    • Sends the web event for the product list view event.

      Parameters

      • Optionaloptions: ProductListViewOptions & EventOptions

        The options to send the web event.

        • OptionalproductListID?: string
        • Optionalproducts?: Product[]
        • Optionalaction?: string
        • Optionallabel?: string
        • Optionalvalue?: number
        • OptionalsemanticAttributes?: {
              query?: string;
              productListID?: string;
              cartID?: string;
              transactionID?: string;
              inAppPurchased?: boolean;
              currency?: string;
              totalValue?: number;
              products?: {
                  productID?: string;
                  name?: string;
                  price?: number;
                  currency?: string;
                  quantity?: number;
                  position?: number;
              }[];
              [key: string]: unknown;
          }

          The semantic attributes to send the web event defined by Airbridge.

        • OptionalcustomAttributes?: Record<string, string>

          The custom attributes to send the web event.

      Returns void

      Use airbridge.events.send() instead.

      airbridge.events.send('airbridge.ecommerce.productList.viewed', { ... })
      
    • Sends the web event for the product details view event.

      Parameters

      • Optionaloptions: ProductDetailsViewOptions & EventOptions

        The options to send the web event.

        • Optionalaction?: string
        • Optionallabel?: string
        • Optionalvalue?: number
        • OptionalsemanticAttributes?: {
              query?: string;
              productListID?: string;
              cartID?: string;
              transactionID?: string;
              inAppPurchased?: boolean;
              currency?: string;
              totalValue?: number;
              products?: {
                  productID?: string;
                  name?: string;
                  price?: number;
                  currency?: string;
                  quantity?: number;
                  position?: number;
              }[];
              [key: string]: unknown;
          }

          The semantic attributes to send the web event defined by Airbridge.

        • OptionalcustomAttributes?: Record<string, string>

          The custom attributes to send the web event.

      Returns void

      Use airbridge.events.send() instead.

      airbridge.events.send('airbridge.ecommerce.product.viewed', { ... })
      
    • Sends the web event for the product added to cart event.

      Parameters

      • Optionaloptions: AddedToCartOptions & EventOptions

        The options to send the web event.

        • OptionalcartID?: string
        • OptionaltotalValue?: number
        • Optionalcurrency?: string
        • Optionalproducts?: Product[]
        • Optionalaction?: string
        • Optionallabel?: string
        • Optionalvalue?: number
        • OptionalsemanticAttributes?: {
              query?: string;
              productListID?: string;
              cartID?: string;
              transactionID?: string;
              inAppPurchased?: boolean;
              currency?: string;
              totalValue?: number;
              products?: {
                  productID?: string;
                  name?: string;
                  price?: number;
                  currency?: string;
                  quantity?: number;
                  position?: number;
              }[];
              [key: string]: unknown;
          }

          The semantic attributes to send the web event defined by Airbridge.

        • OptionalcustomAttributes?: Record<string, string>

          The custom attributes to send the web event.

      Returns void

      Use airbridge.events.send() instead.

      airbridge.events.send('airbridge.ecommerce.product.addedToCart', { ... })
      
    • Sends the web event for the product purchased event.

      Parameters

      • Optionaloptions: PurchasedOptions & EventOptions

        The options to send the web event.

        • OptionalinAppPurchased?: boolean
        • OptionaltotalValue?: number
        • Optionalcurrency?: string
        • OptionaltransactionID?: string
        • Optionalproducts?: Product[]
        • Optionalaction?: string
        • Optionallabel?: string
        • Optionalvalue?: number
        • OptionalsemanticAttributes?: {
              query?: string;
              productListID?: string;
              cartID?: string;
              transactionID?: string;
              inAppPurchased?: boolean;
              currency?: string;
              totalValue?: number;
              products?: {
                  productID?: string;
                  name?: string;
                  price?: number;
                  currency?: string;
                  quantity?: number;
                  position?: number;
              }[];
              [key: string]: unknown;
          }

          The semantic attributes to send the web event defined by Airbridge.

        • OptionalcustomAttributes?: Record<string, string>

          The custom attributes to send the web event.

      Returns void

      Use airbridge.events.send() instead.

      airbridge.events.send('airbridge.ecommerce.order.completed', { ... })