Widget Overview
Embed a beautiful loyalty widget in your website
The useLoyalty Widget is a self-contained loyalty experience that you can embed in any website. It provides members with access to their points, rewards, quests, badges, and referral program.
Features
- Points Display: Show current balance and level progress
- Rewards Catalog: Browse and redeem rewards with points
- Games & Quests: Daily check-ins, spin wheels, scratch cards
- Badges: View earned achievements and progress
- Referrals: Share referral codes and track invites
- Multi-language: Support for 11 languages out of the box
- Themeable: Customize colors, fonts, and positioning
Quick Start
Add the widget to your site with just a few lines of code:
<script src="https://cdn.useloyalty.app/widget/useloyalty-widget.iife.js"></script>
<script>
UseLoyaltyWidget.init({
publicKey: "pk_your_public_key",
externalId: "user_123",
timestamp: Date.now(),
signature: "hmac_signature_from_server",
});
</script>The signature must be generated server-side using your private key. Never expose your private key in client-side code.
Widget Preview
The widget appears as a floating button that opens a drawer containing:
- Profile Bar: Points balance, level, and avatar
- Tab Navigation: Rewards, Quests, Refer
- Content Area: Tab-specific content
- Promo Code Input: Optional code redemption
Documentation
Installation
Step-by-step installation guide with code examples
React Integration
React, Next.js components, hooks, and examples
Configuration
All configuration options and member data
Theming
Customize colors, fonts, and positioning
API Reference
Widget methods and programmatic control
Internationalization
Multi-language support and translations
Browser Support
The widget supports all modern browsers:
| Browser | Minimum Version |
|---|---|
| Chrome | 80+ |
| Firefox | 75+ |
| Safari | 13+ |
| Edge | 80+ |
| iOS Safari | 13+ |
| Android Chrome | 80+ |
Widget States
Launcher Button
A floating button (default: bottom-right corner) that opens the widget drawer. Supports multiple display modes:
- Floating (default): Icon-only or icon with text label
- Custom: No launcher button - trigger via
UseLoyaltyWidget.open()from your own UI
Expanded Drawer
The main widget interface with tabs:
- Rewards Tab: Available rewards, costs, stock status
- Quests Tab: Games, daily check-in, challenges
- Refer Tab: Referral code, social sharing, stats
Achievement Modals
Pop-up celebrations for:
- Level up achievements
- Quest completions
- Reward claims
- Daily check-in streaks
Security
The widget uses HMAC signature verification to authenticate members:
- Your server generates a signature using the private key
- The widget sends the signature with each request
- The API verifies the signature before processing
This ensures that only authenticated members can access their data.