Home
NextSaaS
hero-section-bg

Posfra.js

The Posfra.js SDK makes it quick and easy to integrate seamless Bitcoin payment experiences into any web application.

<script src="https://cdn.posfra.com/posfra.js"></script>

<div 
  class="posfra-pay-button"
  embed-token="f419128f528...d75174399b3"
  usd="30"
  redirect-url="https://yoursite.com/paid"
  data="string:255 chars max"
></div>
gradient

Custom Bitcoin Payment Solutions.

Beyond simple integration with the HTML UI components, Posfra.js allows developers to create tailor-made Bitcoin payment experiences using its low-level JavaScript SDK.

document.addEventListener('DOMContentLoaded', () => {
    const element = document.querySelector('#my-element');
    const embedToken = 'f419128f528d75174399b3662a2e0ceaed29b98a59cbc9d33601fa2f903c1b6f';
    const posfra = new Posfra(embedToken);
    posfra.createPayWithBitcoinButton(element, {
        btc: '0.002',
        ref: 'order-12345',
        redirectURL: 'https://yoursite.com/paid',
        data: '{"customerId":"abc123"}',
    });
});

Fully Client-side

No need for backend servers or APIs.

Test Mode

Build and test your payment workflow without the risk of real transactions.

Redirects

Redirect the user to a custom URL after a successful transaction.

Custom Data

Store upto 500 chars of arbitrary data like user IDs or emails with the transaction.

Events

JS events triggered on UI interactions and transaction lifecycle events.

Blockchain Data

Access transaction blockchain data like txid and confirmations without a backend.