# 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**
