UNPKG

@easyflow/javascript-sdk

Version:

Enterprise-grade JavaScript SDK for Easyflow payment processing platform with enhanced credit card validation, comprehensive TypeScript definitions, and Lovable.dev integration support

155 lines (106 loc) β€’ 4.8 kB
# Easyflow JavaScript SDK - Documentation Hub Welcome to the Easyflow JavaScript SDK documentation hub! This is your central access point to all SDK resources. ## πŸ“š Core Documentation ### [πŸ“– Complete SDK Guide](https://easyflow-cash.github.io/easyflow-javascript-sdk/README.md) The main documentation file containing: - **Quick Start** guide and installation - **API Reference** for all methods - **Complete Examples** for all use cases - **Configuration** and development options - **Error Handling** with standardized codes - **Security Features** and best practices ### [πŸ”§ Data Structures Reference](https://easyflow-cash.github.io/easyflow-javascript-sdk/DATA-STRUCTURES.md) Comprehensive guide to all data structures: - **TypeScript Interfaces** for all data types - **Field-by-field documentation** with validation rules - **Real-world examples** for each structure - **Error codes and messages** reference - **Best practices** for data handling ## πŸš€ Examples & Demos ### [πŸ› Development Mode Example](examples/development-mode-example.html) Interactive demo showcasing: - **Development mode** configuration - **Debug features** and logging - **Event system** (SDKReady, etc.) - **Real-time monitoring** and status ## πŸ“¦ Installation & Distribution ### NPM Package (Recommended for Production) ```bash npm install @easyflow/javascript-sdk ``` **What's included:** - **Production-ready obfuscated code** - Same secure build as CDN - **TypeScript definitions** - Full IntelliSense and type safety - **Complete documentation** - README, INDEX, DATA-STRUCTURES - **Version management** - Easy updates via package.json **Perfect for:** - Modern build tools (Webpack, Vite, Rollup) - TypeScript projects - Node.js applications - Offline development ### CDN Scripts (Alternative) ```html <!-- Cloudflare Pages (Primary) --> <script src="https://easyflow-sdk.pages.dev/easyflow-sdk.min.js"></script> <!-- jsDelivr (Alternative) --> <script src="https://cdn.jsdelivr.net/npm/@easyflow/javascript-sdk@latest/dist/easyflow-sdk.min.js"></script> ``` **Perfect for:** - Quick HTML integration0 - No build step required - Global availability via `window.easyflowSDK` - Simple prototyping ### Security & Distribution Strategy **πŸ”’ Both NPM and CDN contain identical obfuscated code:** - **Source code is obfuscated** and cannot be reverse-engineered - **Security features are identical** in both distributions - **Choose based on your workflow** - both are equally secure - **NPM provides better developer experience** with TypeScript support ## πŸ”— Quick Links - **[🌐 Official Website](https://www.easyflow.digital)** - **[πŸ“¦ NPM Package](https://www.npmjs.com/package/@easyflow/javascript-sdk)** - **[πŸ”§ CDN Scripts](https://easyflow-sdk.pages.dev)** - **[πŸ“§ Contact Support](mailto:contato@easyflow.digital)** ## 🎯 Getting Started 1. **Choose your installation method** (CDN recommended for production) 2. **Read the [Quick Start guide](https://easyflow-cash.github.io/easyflow-javascript-sdk/README.md#quick-start)** in the main README 3. **Reference [DATA-STRUCTURES.md](https://easyflow-cash.github.io/easyflow-javascript-sdk/DATA-STRUCTURES.md)** for detailed field information 4. **Try the [development example](examples/development-mode-example.html)** for hands-on experience ## πŸ“‹ What's New in v2.1.24 - **Development Mode & Debug Features** - Automatic environment detection - **SDK Ready Event System** - Proper initialization handling - **Enhanced Error Handling** - 50+ standardized error codes - **Comprehensive Data Documentation** - Complete structure reference - **Interactive Examples** - Hands-on development experience --- **Built with ❀️ by the Easyflow Team** _For questions and support, contact [contato@easyflow.digital](mailto:contato@easyflow.digital)_ ## πŸš€ **Quick Start** ### **Via NPM (Recomendado para TypeScript)** ```bash npm install @easyflow/javascript-sdk ``` ### **Via CDN (Para projetos simples)** ```html <script src="https://easyflow-sdk.pages.dev/easyflow-sdk.min.js"></script> ``` ## πŸ“š **TypeScript Integration** Para projetos TypeScript, o SDK Γ© exposto globalmente quando carregado via CDN. Adicione as seguintes declaraΓ§Γ΅es ao seu projeto: ```typescript // O SDK estΓ‘ sendo carregado via CDN e exposto globalmente como window.easyflowSDK declare global { interface Window { easyflowSDK: any EasyflowSDK: any } } ``` ### **Exemplo de Uso com TypeScript** ```typescript // Configurar o SDK window.easyflowSDK.configure({ businessId: 'your-business-id' }) // Usar mΓ©todos do SDK const customer = await window.easyflowSDK.createCustomer(customerData) const payment = await window.easyflowSDK.charge(paymentData) ``` ## πŸ”§ **Usage Examples**