1.2.0 • Published 7 months ago

@valtioinc/valtio-react-sdk v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Valtio is a workflow automation platform that helps end-users design and power task-based digital workflows for a variety of use cases. Tasks can include things like filling out forms, e-signatures, uploading documents, identity verification, and many more. Users can assign other users to complete specific workflow steps and the platform will handle notifying the user of their tasks and guiding them through the successful completion of those tasks.


Highlights

This package provides an SDK for embedding Valtio into your React applications.

  • Embed the workflow creator experience to allow application users to create new workflows (coming soon)
  • Embed the workflow sender experience to allow application users to initiate workflows and assign other users to tasks
  • Embed the workflow participant experience to allow application users to complete their workflow tasks
  • Embed the full Valtio platform to allow application users to use all the capabilities of the platform.

Install

npm install @valtioinc/valtio-react-sdk
yarn add @valtioinc/valtio-react-sdk

Usage

Example: Show Valtio when user clicks a button

import React from "react";
import { ValtioApp } from "@valtioinc/valtio-react-sdk";

function App() {
  const [showValtio, setShowValtio] = React.useState(false)

  const onShow = () => {
    /*
     The user has requested to open the Valtio platform.
     */
    setShowValtio(true)
  }
  
  const onHide = () => {
    /*
      The user has requested to exit the Valtio platform and return to your application.
      Handle this event by either switching screens or removing the ValtioApp component.
     */
    setShowValtio(false)
  }
  
  return (
    <div>
      {!showValtio && (
        <header>
          <p>Valtio React App Reference Implementation</p>
          <button onClick={onShow}>Show Valtio</button>
        </header>
      )}
      {showValtio && (
        <ValtioApp
          appID="75a8c8a8-8763-4590-ab5b-4d5278d41724"
          language="en"
          onExit={onHide}
          user={{
            first_name: "John",
            last_name: "Doe",
            email: "john.doe@example.com"
          }}
        />
      )}
    </div>
  )
}

ValtioApp Component Properties

PropertyDescriptionTypeRequiredDefault
appIDA unique identifier for your application and your organization. Please contact the Valtio team to request an application ID.stringYes
hostThe host that will be used to load the embedded Valtio experience. Defaults to Valtio's production system, but can also be set to Valtio's sandbox environment (https://app-integration.valtio.io)stringNohttps://app.valtio.io
languageThe language preference of the user that will be interacting with the Valtio platform. Currently only English ('en') and Spanish ('es') are supported.'en' | 'es'No
debugA flag to enable debug logging in the Javascript console.booleanNofalse
onLoadA callback function that will be invoked when the embedded Valtio experience has finished loading.functionNo
onExitA callback function that will be invoked when the user requests to exit the Valtio experience and return to your application.functionNo
user.first_nameThe first name of the user that will be interacting with the Valtio platform. This will be used to autofill fields in the account sign-up flow.stringNo
user.last_nameThe last name of the user that will be interacting with the Valtio platform. This will be used to autofill fields in the account sign-up flow.stringNo
user.emailThe email of the user that will be interacting with the Valtio platform. This will be used to autofill the email in the account authentication / sign-up flow.stringNo

Author

👤 Valtio Inc


🤝 Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page.


Show your support

Give a ⭐️ if this project helped you!


📝 License

Copyright © 2024 Valtio Inc. This project is MIT licensed.

1.2.0

7 months ago

1.1.1

7 months ago

1.1.0

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago

0.1.0

8 months ago