How gofynd/fdk-client-javascript works
Main Components
a. Core SDK Layer:
• Three main client interfaces: ApplicationClient, PlatformClient, and PublicClient
• Common utilities and base components (BaseOAuthClient, AxiosHelper, etc.)
b. Service Modules Layer:
• Various service modules (Cart, Catalog, Payment, etc.)
• How they inherit from their respective base clients
c. Authentication & Configuration Layer:
• ApplicationConfig, PlatformConfig, and PublicConfig components
• OAuth authentication flow
[Client Applications]
• ↓
[SDK Entry Points]
• ApplicationClient
• PlatformClient
• PublicClient
• ↓
[Configuration Layer]
• ApplicationConfig
• PlatformConfig
• PublicConfig
• ↓
[Common Infrastructure]
• OAuth Handling
• Axios Helpers
• Error Handling
• Logging
• ↓
[Service Modules]
• Cart
• Catalog
• Payment
• Other Services...
• ↓
[External Services]
• Fynd Platform API
Important Elements to Highlight
a. Client Flow:
• How requests flow from client application through the SDK layers
• Where authentication and request signing happens
• Points where cookie handling occurs
b. Module Organization:
• Related services (e.g., all commerce-related modules together)
• Shared components used across different clients
c. Infrastructure Components:
• Error handling mechanisms
• Logging system integration
• Where request/response transformation happens
Relationships
• Inheritance relationships between clients and their base classes
• Dependencies between modules
• Data flow directions
• Authentication token flow
Additional Details
• Version information
• SDK configuration options
• Browser vs Node.js support paths
• Public vs private interfaces
→ Request Flow
⇢ Inheritance
● Required Component
○ Optional Component
█ External System
▢ Internal Module