npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@valkyrie-fnd/valkyrie-event-adapter

v0.2.0

Published

Used by provider to communicate with valkyrie enabled operator

Downloads

8

Readme

valkyrie-event-adapter

Frontend library written in Typescript to use in game provider games to communicate with operator displaying your game.

Also used on operator side in order to map events from providers to your system.

Documentation

Usage

Installing

npm i @valkyrie-fnd/valkyrie-event-adapter

or using yarn

yarn add @valkyrie-fnd/valkyrie-event-adapter

Provider

If your're a provider and want to follow Valkyrie events you use ValkyrieWrapper.

In relevant places in your code you need to call ValkyrieWrapper to notify it of events that happen. Eg vm.gameLoaded() when the game's resources are finished loading.

When implemented fully, you can make use of the test site (read below) to verify your events are being sent as expected. Read the docs what functions exist and verify using the test site.

import { ValkyrieWrapper } from '@valkyrie-fnd/valkyrie-event-adapter';
//...
// Get valkyrieReceiver instance
const vw = new ValkyrieWrapper(window.parent, window, valkyrieReceiver);
const unregister = vw.init();

//....
// Call once the game is loaded and has the UI ready to be shown to the player.
// Should not be called while the game is still in process of loading assets etc
vw.gameLoaded();

//...
// If you need to remove any event listeners
unregister();

valkyrieReceiver needs to implement the ValkyrieReceiver interface.

export interface ValkyrieReceiver {
  autoPlay?: (action: AutoPlayAction) => void
  volume?: (muted: boolean) => void
  refreshBalance?: () => void
}

Commands sent by the wrapper of your game should be handled by it.
Eg. when the wrapper send a autoplay command the autoPlay-function on ValkyrieReceiver will be called and your game should handle it.

unregister is a function that will remove event listeners that is added to the second parameter(window).

Read documentation full here

Operator

TBW

Test site

To verify a game send the correct events and has implemented ValkyrieReceiver interface correctly you can use the test site.

It is available here. To use it, simply paste a url to a game in the input field and validate all events are coming in as expected, as well as validating the game iframe responds to the events sent to it. test-site

The source code for the test site is available here.

Publishing

Make sure CHANGELOG is updated with relevant changes.

When ready to release then use Prepare release workflow to prepare a release. This will create a PR for you to merge. Upon merge of the PR a github release will be created as well as the package published to NPM.