# Blocks
The Blocks provides a JavaScript library for integrating secure, PCI-compliant payment forms into your web applications. It creates iframe-based payment blocks that safely handle sensitive data while allowing full control over styling and integration.
# Installation
# NPM
npm install @tratta/blocks
# CDN
<script src="https://cdn.jsdelivr.net/npm/@tratta/blocks"></script>
# Key Features
- Secure iframe-based payment forms
- PCI-compliant card data handling
- Real-time validation and error handling
- Event-driven architecture for seamless integration
# Quick Integration Guide
// Initialize Tratta with your public key
const tratta = new Tratta('your-public-key');
// Create a card block
const cardBlock = tratta.blocks().create('card', {
hidePostalCode: true
});
// Mount the block to your container
cardBlock.mount('#card-container');
// Handle form submission
const token = await tratta.createToken({
type: 'card',
card: cardBlock
});
# Notes & Next Steps
- The Tratta Blocks SDK (opens new window) is available as an npm package.
- To request a public key, contact us via our form (opens new window).
← API Transactions →