@lazyfi-learning/gamesdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

@lazyfi-learning/gamesdk

Library used to integrate lazyfi games with the website

npm version npm downloads

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

Package Sidebar

Install

npm i @lazyfi-learning/gamesdk

Homepage

lazyfi.gg

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

17.4 kB

Total Files

14

Last publish

Collaborators

  • kalevski
  • lazyfi