@tagadapay/plugin-sdk 2.0.2 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # TagadaPay Plugin SDK
2
2
 
3
- A comprehensive SDK for building checkout plugins on the TagadaPay platform. Create custom checkout experiences with React components, payment processing, and advanced features.
3
+ A comprehensive React SDK for building plugins on the TagadaPay platform. Create custom checkout experiences, landing pages, and interactive components with automatic configuration injection and advanced routing capabilities.pnpm
4
4
 
5
5
  ## 📚 Documentation
6
6
 
@@ -181,33 +181,40 @@ const { storeId, accountId, basePath, config } = usePluginConfig();
181
181
 
182
182
  ## 🎯 Key Features
183
183
 
184
- ### Payment Processing
184
+ ### 🔧 **Plugin Configuration System**
185
+
186
+ - **Automatic Context Injection** - Store ID, Account ID, and custom config
187
+ - **Development & Production** - Seamless environment switching
188
+ - **Generic Configuration** - Support for any JSON structure
189
+ - **React Hooks** - Clean, type-safe configuration access
190
+
191
+ ### 💳 **Payment Processing**
185
192
 
186
193
  - Secure tokenized payments
187
194
  - Multiple payment method support
188
195
  - Real-time validation
189
196
  - PCI compliance
190
197
 
191
- ### Customer Management
198
+ ### 🌍 **Address & Location**
192
199
 
193
- - Profile management
194
- - Address validation
195
- - Order history
196
- - Preferences
200
+ - **Google Places Autocomplete** - Automatic API loading and address parsing
201
+ - **ISO Country/Region Data** - Complete ISO 3166-1/3166-2 database
202
+ - **Address Validation** - Structured component extraction
203
+ - **Multi-language Support** - 11+ languages for international users
197
204
 
198
- ### Cart & Pricing
205
+ ### 🛒 **E-commerce Features**
199
206
 
200
- - Dynamic pricing
201
- - Promotional offers
202
- - Tax calculations
203
- - Currency conversion
207
+ - Dynamic pricing and promotional offers
208
+ - Cart management and tax calculations
209
+ - Currency conversion and formatting
210
+ - Customer profile management
204
211
 
205
- ### UI Components
212
+ ### 🎨 **UI & Development**
206
213
 
207
- - Pre-built checkout components
208
- - Customizable themes
209
- - Mobile-optimized
210
- - Accessibility features
214
+ - Pre-built React components
215
+ - Customizable themes with configuration
216
+ - Mobile-optimized and accessible
217
+ - TypeScript support throughout
211
218
 
212
219
  ## 📖 API Reference
213
220
 
package/dist/index.d.ts CHANGED
@@ -1,33 +1,16 @@
1
1
  /**
2
2
  * Tagada Pay Plugin SDK
3
3
  *
4
- * Modern React SDK for building Tagada Pay plugins
4
+ * Core SDK for building Tagada Pay plugins
5
5
  *
6
- * Usage:
6
+ * For React-specific functionality, use:
7
7
  * ```tsx
8
8
  * import { TagadaProvider, useCustomer } from '@tagadapay/plugin-sdk/react';
9
- *
10
- * function App() {
11
- * return (
12
- * <TagadaProvider>
13
- * <MyPlugin />
14
- * </TagadaProvider>
15
- * );
16
- * }
17
- *
18
- * function MyPlugin() {
19
- * const { customer, isAuthenticated } = useCustomer();
20
- *
21
- * return (
22
- * <div>
23
- * {isAuthenticated ? (
24
- * <p>Welcome back, {customer.firstName}!</p>
25
- * ) : (
26
- * <p>Welcome, guest!</p>
27
- * )}
28
- * </div>
29
- * );
30
- * }
31
9
  * ```
10
+ *
11
+ * This main export contains non-React utilities and types.
32
12
  */
33
- export * from './react';
13
+ export type { Currency, Customer, Environment, EnvironmentConfig, Locale, Order, OrderAddress, OrderItem, OrderSummary, PickupPoint, Session, Store, } from './react/types';
14
+ export { convertCurrency, formatMoney, formatMoneyWithoutSymbol, formatSimpleMoney, getCurrencyInfo, minorUnitsToMajorUnits, moneyStringOrNumberToMinorUnits, } from './react/utils/money';
15
+ export * from './data/countries';
16
+ export * from './data/iso3166';
package/dist/index.js CHANGED
@@ -1,37 +1,17 @@
1
1
  /**
2
2
  * Tagada Pay Plugin SDK
3
3
  *
4
- * Modern React SDK for building Tagada Pay plugins
4
+ * Core SDK for building Tagada Pay plugins
5
5
  *
6
- * Usage:
6
+ * For React-specific functionality, use:
7
7
  * ```tsx
8
8
  * import { TagadaProvider, useCustomer } from '@tagadapay/plugin-sdk/react';
9
- *
10
- * function App() {
11
- * return (
12
- * <TagadaProvider>
13
- * <MyPlugin />
14
- * </TagadaProvider>
15
- * );
16
- * }
17
- *
18
- * function MyPlugin() {
19
- * const { customer, isAuthenticated } = useCustomer();
20
- *
21
- * return (
22
- * <div>
23
- * {isAuthenticated ? (
24
- * <p>Welcome back, {customer.firstName}!</p>
25
- * ) : (
26
- * <p>Welcome, guest!</p>
27
- * )}
28
- * </div>
29
- * );
30
- * }
31
9
  * ```
10
+ *
11
+ * This main export contains non-React utilities and types.
32
12
  */
33
- // Export the new React SDK
34
- export * from './react';
35
- // Bridge functionality has been moved to separate imports to prevent SSR issues
36
- // If you need the deprecated bridge, explicitly import from '@tagadapay/plugin-sdk/bridge'
37
- // Example: import { initializePlugin } from '@tagadapay/plugin-sdk/bridge'
13
+ // Export utility functions that don't depend on React
14
+ export { convertCurrency, formatMoney, formatMoneyWithoutSymbol, formatSimpleMoney, getCurrencyInfo, minorUnitsToMajorUnits, moneyStringOrNumberToMinorUnits, } from './react/utils/money';
15
+ // Export data utilities
16
+ export * from './data/countries';
17
+ export * from './data/iso3166';
@@ -15,6 +15,7 @@ export { useOrderBump } from './hooks/useOrderBump';
15
15
  export { usePostPurchases } from './hooks/usePostPurchases';
16
16
  export { useProducts } from './hooks/useProducts';
17
17
  export { useSession } from './hooks/useSession';
18
+ export { useTagadaContext } from './providers/TagadaProvider';
18
19
  export { usePluginConfig, useBasePath, getPluginConfig, clearPluginConfigCache, debugPluginConfig } from './hooks/usePluginConfig';
19
20
  export type { PluginConfig } from './hooks/usePluginConfig';
20
21
  export { useGoogleAutocomplete, useGoogleMapsLoaded } from './hooks/useGoogleAutocomplete';
@@ -28,7 +29,7 @@ export { usePaymentPolling } from './hooks/usePaymentPolling';
28
29
  export { useThreeds } from './hooks/useThreeds';
29
30
  export { useThreedsModal } from './hooks/useThreedsModal';
30
31
  export type { AuthState, Currency, Customer, Environment, EnvironmentConfig, Locale, Order, OrderAddress, OrderItem, OrderSummary, PickupPoint, Session, Store, } from './types';
31
- export type { CheckoutData, CheckoutInitParams, CheckoutLineItem, CheckoutSession, Promotion, UseCheckoutOptions, UseCheckoutResult, } from './hooks/useCheckout';
32
+ export type { CheckoutSessionPreview, CheckoutData, CheckoutInitParams, CheckoutLineItem, CheckoutSession, Promotion, UseCheckoutOptions, UseCheckoutResult, } from './hooks/useCheckout';
32
33
  export type { OrderBumpPreview, UseOrderBumpOptions, UseOrderBumpResult } from './hooks/useOrderBump';
33
34
  export type { PostPurchaseOffer, PostPurchaseOfferItem, PostPurchaseOfferLineItem, PostPurchaseOfferSummary, UsePostPurchasesOptions, UsePostPurchasesResult, } from './hooks/usePostPurchases';
34
35
  export type { AddressData, AddressField, Country, State, UseAddressOptions, UseAddressResult, } from './hooks/useAddress';
@@ -18,6 +18,7 @@ export { useOrderBump } from './hooks/useOrderBump';
18
18
  export { usePostPurchases } from './hooks/usePostPurchases';
19
19
  export { useProducts } from './hooks/useProducts';
20
20
  export { useSession } from './hooks/useSession';
21
+ export { useTagadaContext } from './providers/TagadaProvider';
21
22
  // Plugin configuration hooks
22
23
  export { usePluginConfig, useBasePath, getPluginConfig, clearPluginConfigCache, debugPluginConfig } from './hooks/usePluginConfig';
23
24
  // Google Places hooks
package/package.json CHANGED
@@ -1,9 +1,21 @@
1
1
  {
2
2
  "name": "@tagadapay/plugin-sdk",
3
- "version": "2.0.2",
3
+ "version": "2.1.2",
4
4
  "description": "Modern React SDK for building Tagada Pay plugins",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.js"
12
+ },
13
+ "./react": {
14
+ "types": "./dist/react/index.d.ts",
15
+ "import": "./dist/react/index.js",
16
+ "require": "./dist/react/index.js"
17
+ }
18
+ },
7
19
  "scripts": {
8
20
  "build": "tsc",
9
21
  "clean": "rm -rf dist",