This package has everything you need to develop a ChuttApp In-App service.
With npm
npm install @chuttapp/in-app-react
With yarn
yarn add @chuttapp/in-app-react
For Nodejs environments.
React
, Angular
etc.
import { InAppService, Button, ... } from '@chuttapp/in-app-react'
Browser environment.
<script src="@chuttapp/in-app-react/dist/esm/index.browser" type="module">
</script>
...or inlcude bundle
<script src="https://unpkg.com/@chuttapp/in-app-react@{{PKG_VERSION}}/dist/esm/index.browser.js"></script>
import { onPay } from '@chuttapp/in-app-react'
const onPayClick = () => {
const payload = {
amount: 3.5, // REQUIRED
currency: 'GHS', // REQUIRED
data: {
// ...pass stuff here (OPTIONAL)
}
}
onPay(payload)
}
import { onOpenScanner } from '@chuttapp/in-app-react'
const openScanner = () => {
onOpenScanner()
}