Skip to main content

Show Profile Widget

Display the Gameball customer profile widget that contains customer details, available reward campaigns, leaderboard, and more.

Basic Usage

🔒
Secure API Access: To benefit from v4.1 secure API endpoints, pass the sessionToken parameter when showing the profile widget (required in upcoming SDK v4). This enables automatic routing to v4.1 secure endpoints. Learn more about v4.1 →

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.
boolean
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:
  • customerId is 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

Hide navigation works best when combined with openDetail to lead users to a specific section.
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.
Consider showing the profile widget after a customer earns points to increase engagement and encourage repeat purchases. Users are more likely to interact with the widget when they’ve just been rewarded.
Ensure you’ve initialized the customer with initializeCustomer() before calling showProfile() to guarantee the widget displays accurate customer data. Also, make sure react-native-webview is properly installed as the widget depends on it.

Next Steps