Skip to content

Latest commit

 

History

History
46 lines (38 loc) · 1.42 KB

Readme.md

File metadata and controls

46 lines (38 loc) · 1.42 KB

Instant Games Bridge

One SDK for cross-platform publishing HTML5 games.

Supported platforms:

  1. VK.COM
  2. Yandex Games

Plugins for game engines:

Join community: https://t.me/instant_games_bridge.

Usage

<script src="https://cdn.jsdelivr.net/gh/mewtongames/[email protected]/dist/instant-games-bridge.js"></script>
<script>
    instantGamesBridge
        .initialize()
        .then(() => {
            // Initialized. You can use other methods.
            console.log('Platform ID:', instantGamesBridge.platform.id)
        })
    
    instantGamesBridge.advertisement.on('interstitial_state_changed', state => console.log('Interstitial state:', state))
    instantGamesBridge.advertisement.on('rewarded_state_changed', state => console.log('Rewarded state:', state))

    instantGamesBridge.advertisement.showInterstitial()
    instantGamesBridge.advertisement.showRewarded()

    instantGamesBridge
        .game
        .getData(key)
        .then(data => {
            console.log('Data:', data)
        })

    instantGamesBridge
        .game
        .setData(key, value)
        .then(() => {
            console.log('SetData success')
        })
</script>