1invoice-chat-widget
v0.2.2
Published
React widget package for the 1Invoice onboarding chat flow.
Downloads
1,469
Readme
1invoice-chat-widget
React widget package for the 1Invoice onboarding chat flow.
The widget uses @invoice-sdk/id_extraction_qr for CCCD front-side QR detection/OCR, so consuming Vite apps do not need to copy /scripts/ocr-sdk.js.
Build
yarn build:widgetor:
yarn workspace 1invoice-chat-widget buildUsage In A Vite App
yarn add 1invoice-chat-widgetimport { InvoiceChatWidget } from '1invoice-chat-widget'
import '1invoice-chat-widget/style.css'
export default function App() {
return (
<InvoiceChatWidget
apiBaseUrl={import.meta.env.VITE_INVOICE_HUB_URL}
providerCode="one-invoice"
bankCode={import.meta.env.VITE_INVOICE_HUB_BANK_CODE}
/>
)
}Props
type InvoiceChatWidgetProps = {
apiBaseUrl?: string
providerCode?: string
bankCode?: string
basePath?: string
className?: string
style?: React.CSSProperties
onClose?: () => void
}apiBaseUrl can also fall back to VITE_INVOICE_HUB_URL when the consumer app is Vite-based.
