Quick Start
Script Attributes
Add these attributes to the<script> tag:
| Attribute | Description |
|---|---|
data-auto-init | Automatically initialize the SDK on page load |
data-auto-display-checkout | Automatically open checkout on page load (for dedicated checkout pages) |
data-fungies-checkout-url | Checkout URL (required with data-auto-display-checkout) |
data-fungies-mode | Display mode: overlay or embed |
data-fungies-frame-target | Target element ID for embed mode |
Auto-Display Example
For dedicated checkout pages that should immediately show the checkout:Button Attributes
Add these attributes to any clickable element (button, anchor, div, etc.):Required
| Attribute | Description |
|---|---|
data-fungies-checkout-url | The checkout URL from your Fungies dashboard |
Display Options
| Attribute | Values | Description |
|---|---|---|
data-fungies-mode | overlay, embed | How to display the checkout (default: overlay) |
data-fungies-frame-target | Element ID | Target element for embed mode |
Billing Data
| Attribute | Description |
|---|---|
data-fungies-billing-email | Customer email |
data-fungies-billing-first-name | Customer first name |
data-fungies-billing-last-name | Customer last name |
data-fungies-billing-country | Country code (e.g., US, GB, PL) |
data-fungies-billing-state | State/province |
data-fungies-billing-city | City |
data-fungies-billing-zip-code | Postal/ZIP code |
Other Options
| Attribute | Description |
|---|---|
data-fungies-discount-code | Discount code to apply |
data-fungies-quantity | Product quantity |
data-fungies-items | JSON array of items (for multi-product) |
data-fungies-custom-fields | JSON object of custom fields |
Legacy (Deprecated)
| Attribute | Description |
|---|---|
data-fungies-customer-email | Use data-fungies-billing-email instead |
data-fungies-button | Legacy URL format, use data-fungies-checkout-url instead |
Complete Examples
Basic Overlay Button
With Prefilled Billing Data
With Discount Code
With Quantity
Multi-Product Checkout
With Custom Fields
Embedded Checkout
Styling
The SDK doesn’t add any styles to your buttons. Style them however you want:Dynamic Elements
If you add checkout buttons dynamically (e.g., via JavaScript or a framework), callFungies.ScanDOM() to attach click handlers: