API Reference
React

API Reference

ChurnAware Component Props

appId (required)

The appId is the unique identifier for your Churnaware app. It is required to be passed to the Churnaware component in order to recieve and send data.

<Churnaware appId="get-this-value-from-your-dashboard" />

theme

The theme prop allows you to choose between a light and dark theme for the Churnaware component. If not set, the theme will be defaulted to light.

<Churnaware appId="get-this-value-from-your-dashboard" />

isOpen

The isOpen prop allows you to control the visibility state of the Churnaware component externally. When provided, you must also provide the onOpen and onClose handlers.

const [isOpen, setIsOpen] = useState(false);
 
<Churnaware
  appId="get-this-value-from-your-dashboard"
  isOpen={isOpen}
  onOpen={() => setIsOpen(true)}
  onClose={() => setIsOpen(false)}
/>;

onOpen

The onOpen callback function is required when using controlled visibility with the isOpen prop. It is called when the component should be opened.

<Churnaware
  appId="get-this-value-from-your-dashboard"
  isOpen={isOpen}
  onOpen={() => setIsOpen(true)}
  onClose={onClose}
/>

onClose

The onClose callback function is required when using controlled visibility with the isOpen prop. It is called when the component should be closed.

<Churnaware
  appId="get-this-value-from-your-dashboard"
  isOpen={isOpen}
  onOpen={onOpen}
  onClose={() => setIsOpen(false)}
/>