New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@statflo/textkit-widget-events

Package Overview
Dependencies
Maintainers
5
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@statflo/textkit-widget-events

TextKit Events for Widgets

  • 1.3.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-75%
Maintainers
5
Weekly downloads
 
Created
Source

TextKit by Statflo

TextKit Widget Events

This package defines all the available events within the TextKit platform this package extends the Widget SDK package. We export all the functionality from that package along with our implementation of it.

We also include the necessary iframeResizer.contentWindow.min.js file needed for external widgets. This will always be included therefore it's not necessary to include or import.

Installation

yarn add @statflo/textkit-widget-events

More Documentation

For more information on widget communication or container intialization you can refer to our Widget SDK Readme

Container Initialization

This function will create the initial Widget State.

Usage

import { createWidgetState, ContainerClient } from '@statflo/textkit-widget-events'

// Initialize Container
const containerClient = new ContainerClient({ window });

// Set the widgets unique id
const id = 'widgetId';

// Initialize widget inside client with default state
containerClient.createWidget(createWidgetState(id));

Widget Initialization

import { WidgetClient } from "@statflo/widget-sdk";

export const client = new WidgetClient({ 
  id: "my widget",
  window,
  createWidgetState: (id) => ({ id }),
});

Events

Usage

import { EventNames } from '@statflo/textkit-widget-events'

Widget Properties

EventNames.widget.postForwardExample: This event will forward the event data to other widgets this is for cross widget communication.

EventNames.widget.actionCreationFailed: This event will alert of error when actions are created.

EventNames.widget.appendTextToMessage: This event will append text to the message box.

EventNames.widget.replaceTextMessage: This event will replace the contents of the message box.

Container Events

EventNames.container.activeConversationChanged: This event will include context data when a conversation changes within TextKit so you can know with whom you are speaking to.

EventNames.container.appContextChanged: This event will include context data about the app session.

Widget Types

Usage

import { WidgetTypes } from '@statflo/textkit-widget-events'

Enum values

  • Standard
  • Action
  • Timeline
  • Sendable

Widget Scopes

Usage

import { WidgetScope } from '@statflo/textkit-widget-events'

Enum values

  • User
  • Conversation

Widget Tabs

Usage

import { WidgetTabs } from '@statflo/textkit-widget-events';

Enum values

  • Widget
  • Timeline

Widget State

Usage

import { WidgetState } from '@statflo/textkit-widget-events'

Enum values

  • containerDomain
  • footer
  • header
  • id
  • isOpen
  • isReady
  • isShown
  • label
  • maxHeight
  • size
  • type
  • url
  • widgetDomain

Widget View Sizes

Usage

import { WidgetViewSize } from '@statflo/textkit-widget-events'

Enum values

  • Large
  • Medium
  • Small

Debug Log

Usage

import { DebugLogLevel } from '@statflo/textkit-widget-events'

Enm values

  • None
  • Debug

Example

import { DebugLogLevel, ContainerClient } from '@statflo/textkit-widget-events';

export const widgetContainerClient = new ContainerClient({
  logs: DebugLogLevel.None,
  window,
});

FAQs

Package last updated on 03 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc