Use PromptParse via CDN in the browser
mainYou can use PromptParse directly in a web browser by including the library via a CDN script tag. The library is exposed under the global promptparse object. For example, you can access promptparse.generate to create payloads for various services like TrueMoney.
<script src="https://cdn.jsdelivr.net/npm/promptparse"></script>
<script>
;(function () {
// Generate QR code payload (use function from "promptparse" global)
const payload = promptparse.generate.trueMoney({
mobileNo: '08xxxxxxxx',
amount: 10.0,
message: 'Hello World!',
})
// Quick & dirty way to show QR Code image
document.write(
`<img src="https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=${payload}">`,
)
})()
</script>