puzzleme-games
v1.0.4
Published
This react component allows embedding of games created on PuzzleMe platform (www.amuselabs.com) on a webpage.
Downloads
22
Maintainers
Readme
PuzzleGame
A React component for embedding a puzzle game in your application. This component dynamically loads a script and renders an iframe for the game.
Installation
You can install the puzzleme-games
package via npm:
npm install puzzleme-games
Peer Dependencies
This component requires react
and react-dom
as peer dependencies:
npm install react react-dom
Usage
Here’s how you can use the PuzzleGame
component in your React application:
import React from 'react';
import PuzzleGame from 'puzzleme-games';
const App = () => (
<div>
<h1>Welcome to the Puzzle Game</h1>
<PuzzleGame
dataId="44e134ad"
dataSet="test-temp1"
baseURL="https://amuselabs.com/pmm" // Your base URL for loading the script
/>
</div>
);
export default App;
Props
| Prop | Type | Required | Description |
|--------------------|----------|----------|--------------------------------------------------|
| dataId
| string
| Yes | Unique identifier for the game instance. |
| dataSet
| string
| No | Optional dataset identifier. |
| baseURL
| string
| Yes | Base URL for loading the game script. |
License
This project is licensed under the MIT License - see the LICENSE file for details.