@tech.unberry/unberry-player
v0.1.18
Published
<p style="margin-bottom: 0" align="center"> <img width="200" height="200" src="https://unberry-sdk-assets.s3.ap-south-1.amazonaws.com/Unberry.png"> </p> <h1 align="center" style="margin-top: 0"> Unberry Player </h1>
Downloads
530
Readme
Installation
Install the package via npm
:
npm install @tech.unberry/unberry-player
or
yarn add @tech.unberry/unberry-player
Usage
- Import unberry-player after installation
import UnberryPlayer from '@tech.unberry/unberry-player';
- Include unberry-player component
<UnberryPlayer />
Minimal Example
import UnberryPlayer from '@tech.unberry/unberry-player';
<UnberryPlayer
apiKey={'API_KEY'}
onGameLevelEnd={(data) => {}}
gameInfo={{
gameId: 'xxxx-xxxx-xxxxx-xxxxxx-xxxxx',
gameUrl: 'htps://xxx-game-url.com',
}}
onGameClose={() => {
// hide the game by not sending anything in gameInfo
}}
playerInfo={{
id: 'yyyydf4f4t4t4',
name: 'Nikhil',
email: '[email protected]',
}}
/>;