Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mainframe/bot-ui

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mainframe/bot-ui

This documentation only covers the JavaScript UI framework, see the [Mainframe bots documentation](http://developer.mainframe.com/) for more information about creating Mainframe bots, and the [bots SDK repository](https://github.com/thusfresh/bot-sdk-js)

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
Weekly downloads
 
Created
Source

Mainframe JavaScript UI framework for bots

This documentation only covers the JavaScript UI framework, see the Mainframe bots documentation for more information about creating Mainframe bots, and the bots SDK repository to get started implementing a bot in JavaScript.

Installation

npm install @mainframe/bot-ui # npm
yarn add @mainframe/bot-ui # Yarn

Example

const React = require('react')
const { render, Text } = require('@mainframe/bot-ui')

const ui = render(<Text>Hello bot!</Text>)

Usage

This UI framework is meant as a complement to the JavaScript bot SDK, exposing the components supported by the client UI and a render() function converting a JSX tree to an UIComponent tree expected by the Mainframe server.

The render() function expects a React.Element, the provided JSX must therefore be transpiled, for example using Babel's React JSX transform plugin.

API

React

Alias to React library. It needs to be imported in scope when using Babel's React JSX transform plugin so that JSX can be converted to React.createElement() calls.

render

Alias to React JSON renderer convertToObject function. Converts the JSX tree into a JS Object supported by the Mainframe platform.

Components

All the documented components are exposed by this UI framework so they can be used to create the JSX tree.

License

MIT
See LICENSE file

FAQs

Package last updated on 05 Sep 2017

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