@lazyfi-learning/gamesdk
v0.1.2
Published
SDK for integrating lazyfi games
Downloads
1
Readme
@lazyfi-learning/gamesdk
Library used to integrate lazyfi games with the website
Setup
npm install @lazyfi-learning/gamesdk
Website setup
import { WebSDK } from '@lazyfi-learning/gamesdk'
const websdk = new WebSDK({
baseURL: 'https://lazyfi.gg' // http://localhost:8080 for dev environment
})
Game setup
import { GameSDK } from '@lazyfi-learning/gamesdk'
const websdk = new GameSDK({
baseURL: 'https://lazyfi.gg' // http://localhost:8080 for dev environment
})
Events
Subsribe to events using
${websdk|gamesdk}.events.on(event, callbackFn, context)
Event names
- start - dispatched on game session start
- stop - dispatched on game session stop
- question - dispached after receiving question requested by the game
- answer - dispatched after sending answer to any question