TypeScript Types
The Glood Hydrogen SDK is built with TypeScript-first design, providing comprehensive type definitions for all interfaces, configurations, and data structures.Core Configuration Types
GloodConfig
Main configuration interface for creating a Glood client.PixelConfig
Configuration for pixel tracking per app.App Configuration Types
RecommendationsAppConfig
Configuration specific to the recommendations app.SearchAppConfig
Configuration specific to the search app.WishlistAppConfig
Configuration specific to the wishlist app.Client & App Types
GloodClient
The main client interface returned bycreateGlood()
.
GloodApp
Interface representing an individual app instance.GloodAppModule
Function type for app module factories.React Component Types
GloodProviderProps
Props for the GloodProvider React component.Analytics Event Data Types
PageViewData
Data structure for page view events.ProductViewData
Data structure for product view events.SearchData
Data structure for search events.CollectionViewData
Data structure for collection view events.CartViewData
Data structure for cart view events.Pixel System Types
PixelEvent
Structure for pixel events in the transmission queue.PixelPayload
Complete pixel payload sent to Glood endpoints.Constant Types
AppName
Union type for available app names.EventType
Union type for all supported analytics events.ConsentType
Union type for customer privacy consent types.Type Guards and Utilities
Type Guard Functions
Helper functions to check types at runtime:Utility Types
Common utility types for working with the SDK:Advanced TypeScript Usage
Generic App Factory
Create type-safe app factories:Type-Safe Configuration Builder
Build configurations with compile-time validation:Event Handler Typing
Type-safe event handlers:Type Imports
Import specific types as needed:Common TypeScript Patterns
Optional Configuration
Make app configurations optional with defaults:Conditional App Configuration
Configure apps based on conditions:Best Practices
1. Use Strict Types
Enable strict TypeScript settings:2. Type Imports
Use type-only imports when possible:3. Const Assertions
Use const assertions for literal types:4. Generic Constraints
Use generic constraints for type safety:See Also
- Client API - Using types with createGlood()
- Components - React component types
- App Modules - App configuration types
- Configuration Guide - Type-safe configuration patterns