
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@gamifyhost/gamifyhost-widget
Advanced tools
An embeddable React widget that brings gamification features to any website
An embeddable React widget that brings gamification features to any website. Includes interactive games, leaderboards, and a complete reward system with style isolation via Shadow DOM.
Add the widget script to your HTML:
<script
src="https://cdn.gamifyhost.com/widget.js"
data-public-key="your_public_key_here"
data-user-id="unique_user_id"
data-initial-balance="1000"
data-api-url="https://api.gamifyhost.com"
data-container="gamifyhost"
></script>
The widget will automatically initialize and render in the specified container.
| Attribute | Required | Default | Description |
|---|---|---|---|
data-public-key | ✅ Yes | - | Your GamifyHost public API key |
data-user-id | ❌ No | - | Unique identifier for the current user |
data-initial-balance | ❌ No | 0 | Starting balance for the user |
data-api-url | ❌ No | https://api.gamifyhost.com | API endpoint URL |
data-container | ❌ No | gamifyhost | ID of the container element |
Basic Setup:
<script
src="https://cdn.gamifyhost.com/widget.js"
data-public-key="pk_live_abc123"
></script>
With User Session:
<script
src="https://cdn.gamifyhost.com/widget.js"
data-public-key="pk_live_abc123"
data-user-id="user_xyz789"
data-initial-balance="500"
></script>
Custom Container:
<div id="my-games-widget"></div>
<script
src="https://cdn.gamifyhost.com/widget.js"
data-public-key="pk_live_abc123"
data-container="my-games-widget"
></script>
git clone https://github.com/gamifyhost/gamifyhost-widget.git
cd gamifyhost-widget
npm install
npm run dev
test.html in your browser to see the widget in action.npm run dev - Start Vite development servernpm run build - Build for productionnpm run preview - Preview production build locallygamifyhost-widget/
├── src/
│ ├── components/ # React components
│ │ └── EnergyMeter.tsx
│ ├── hooks/ # Custom React hooks
│ │ └── useGameSounds.ts
│ ├── lib/ # Core libraries
│ │ ├── api.ts # API client
│ │ ├── config.ts # SDK configuration
│ │ ├── context.tsx # React context
│ │ └── theme.tsx # Theme management
│ ├── pages/ # Game pages
│ │ ├── HomePage.tsx
│ │ ├── NeonWheelPage.tsx
│ │ ├── CosmicSlotsPage.tsx
│ │ ├── EnigmaBoxesPage.tsx
│ │ └── LeaderboardPage.tsx
│ ├── App.tsx # Main app component
│ ├── router.tsx # Client-side routing
│ ├── widget.ts # Widget initialization
│ ├── fonts.ts # Font injection
│ └── globals.css # Global styles
├── test.html # Test page for development
├── package.json
├── tsconfig.json
├── vite.config.ts
└── README.md
The widget uses Shadow DOM to prevent CSS conflicts with the host page:
<script> tagThis ensures the widget's styles won't affect your page and vice versa.
The widget communicates with the GamifyHost API to:
Supports light and dark modes with automatic detection:
The widget uses Tailwind CSS with custom design tokens. To customize:
src/globals.css for global theme variables.tsx filesnpm run buildTo add new games:
src/pages/src/router.tsxsrc/pages/HomePage.tsxWe welcome contributions! Please follow these steps:
git checkout -b feature/my-featuregit commit -m 'Add new game feature'git push origin feature/my-featureThis project is licensed under the MIT License - see the LICENSE file for details.
For questions, issues, or feature requests:
Made with ⚡ by the GamifyHost team
FAQs
An embeddable React widget that brings gamification features to any website
We found that @gamifyhost/gamifyhost-widget demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.