Show Profile Widget
Display the Gameball customer profile widget that contains customer details, available reward campaigns, leaderboard, and more.Basic Usage
Request Parameters
string
Unique identifier for the customer whose profile to display (optional for guest mode).
boolean
Show a close button in the widget. Defaults to
false.string
Specific widget section to open: ‘profile’, ‘achievements’, ‘rewards’. Opens the main view by default.
Hide widget navigation elements. Defaults to
false.string
Close button color in hex format (e.g., ‘#FF6B6B’). Only applies if
showCloseButton is true.string
Optional session token to override the global token for this specific request. Required in upcoming SDK v4.
In React Native SDK, passing a sessionToken parameter updates the global session token. Pass
undefined to clear the global token, or omit it to use the current global token.Validation Rules
ShowProfileRequest notes:customerIdis optional; omit it to show the widget in guest mode
Advanced Configuration
Open Specific Section
Open a specific section of the profile widget directly:Custom Close Button
Add a custom-styled close button:Hide Navigation
Display the widget without navigation controls:Guest Mode
Show the widget without authenticating a customer:Implementation Examples
Show Profile Button
Display the profile widget when user taps a button:Tab Navigator Integration
Integrate with React Navigation tab navigator:Context-Based Profile
Show different sections based on user context:Floating Action Button
Add a rewards button as a floating action button:Widget Content
The profile widget displays:Customer Info
Display name, points balance, tier level, and customer status
Reward Campaigns
Available rewards, challenges, and how to earn them
Leaderboard
Customer ranking, top performers, and competitive standings
Transaction History
Points earned and redeemed history with detailed breakdown
The widget content, design, and branding can be fully customized from your Gameball dashboard.
Error Handling
Best Practices
1
Prominent Access
Place the profile widget button in an easily accessible location (e.g., main navigation, profile screen, bottom tab bar).
2
Badge Indicators
Show badge notifications when customers earn new rewards or achievements to increase engagement.
3
Deep Linking
Use the
openDetail parameter to deep link to specific sections based on user context (e.g., open rewards after purchase).4
Consistent Styling
Match the close button color with your app’s theme using
closeButtonColor for a cohesive user experience.5
Error Handling
Always implement proper error handling to provide feedback when the widget fails to load.
6
Loading States
Consider showing a loading indicator while the widget is being displayed.