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.
You can install this package with npm:
npm i --save @oneschema/filefeeds-react
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>
)
}
Please see 📚 OneSchema's documentation for