@oneschema/filefeeds-react
TypeScript icon, indicating that this package has built-in type declarations

0.5.2 • Public • Published

OneSchema FileFeeds

A tool for embedding OneSchema FileFeeds into your application with React.

This library contains a React component which will allow you to add an iframe to your application which can create new OneSchema FileFeeds and edit their transforms.

Getting Started

Installation

You can install this package with npm:

npm i --save @oneschema/filefeeds-react

Sample usage

import React, { useState } from "react"
import OneSchemaFileFeeds from "@oneschema/filefeeds-react"

function OneSchemaFileFeedsExample() {
  const [isOpen, setIsOpen] = useState(false)

  const handleData = (data) => {
    console.log(data)
  }

  return (
    <div>
      <button onClick={() => setIsOpen(true)}>Open the file feed transforms</button>

      <OneSchemaFileFeeds
        /* managing state from your application */
        isOpen={isOpen}
        /* required config values */
        userJwt={userJwt}
        /* optional config values */
        devMode={process.env.NODE_ENV !== "production"}
        style={{
          position: "fixed",
          top: 0,
          left: 0,
          width: "100vw",
          height: "100vh",
        }}
        inline={false}
        /* handling results */
        onInitFail={(data) => updateStatus("Initialization failed.", data)}
        onInitSucceed={(data) => {
          setSessionId(data.sessionId)
          updateStatus("Initialization succeeded.", data)
        }}
        onSave={(data) => updateStatus("Saved.", data)}
      />
    </div>
  )
}

Documentation

Please see 📚 OneSchema's documentation for ▶️ Getting Started, 📒 API reference and other helpful guides.

Readme

Keywords

none

Package Sidebar

Install

npm i @oneschema/filefeeds-react

Weekly Downloads

1,025

Version

0.5.2

License

MIT

Unpacked Size

216 kB

Total Files

17

Last publish

Collaborators

  • andrewjluo
  • brianbrianschema
  • behnam-oneschema
  • osjennkao