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

@azerion/h5-azerion-branding

v0.13.9

Published

Azerion branding library, similar to @azerion/splash but not tied into Phaser :)

Downloads

453

Readme

h5-azerion-branding

This library is a simpeler version of the Splash screen, with no attachment to Phaser. This means that there is no splash, only utilities and image URL's

Branding

The most important part of this lib, as the name suggests, is the branding part. In order to have the branding (and the utilities for that matter) work correctly, you need to preload some files first. This library can handle this framework agnostic and the only thing you have to do is the following during your game's load setup:

h5branding.Branding.preload('version-for-cachebusting');

After this there are 3 main method you'll probably use a lot and some helpers that might be used occasionally. The main 3 methods are:

// This will allow you to get the correct URL to a branding logo
h5branding.Branding.brandingLogoUrl();

// Will open a new window to a site corrosponding to the branding that's leading for the current view location
h5branding.Branding.openCampaignLink('my-game-name', h5branding.UtmTargets.more_games); 

// Should be used to check if the game allows links that escape the game, eg; walktrough buttons, logo's with links.
// h5branding.Branding.brandingLogoUrl honours this logic.
h5branding.Branding.outGoingLinksAllowed();

Apart from these there are some individual helper methods that allow you to check for individual platforms/portals:

h5branding.Branding.isInternal();    // Checks internal portal json
h5branding.Branding.isContracted();  // Checks contracted json
h5branding.Branding.isSpecial();     // Checks special json
h5branding.Branding.isAdmeen();
h5branding.Branding.isKongregate();
h5branding.Branding.isNewgrounds();
h5branding.Branding.isBild();
h5branding.Branding.isBip();
h5branding.Branding.isPlaycellApp();
h5branding.Branding.isSpil();
h5branding.Branding.isAirfi();

Utilities

The utilities part is mostly used as simple helpers for the Branding part, but also includes some tiny other pieces of code that might be helpfull.

Let's start with the domain checking, in essence these are some helper parts that will allow you to filter the domain from which the game is called from. This can either be a direct call (apps / gd / partners like yandex), or an iframe call (anyn other inclusion :D).

h5branding.Utils.getSourceSite();        // Get the site from which this game/script is loaded
h5branding.Utils.getBrandingDomain()     // Get the Branding that is tied to the current site, will return any of h5branding.BrandingDomain
h5branding.Utils.getDomain('http://test.com/foo')    // Get the domain of any URI, example returns test.com
h5branding.Utils.isTc()                  //  If it runs on internal TeamCity
h5branding.Utils.inIframe()        
h5branding.Utils.getUrlParameter('key')  // Get the value of an url parameter called 'key'        

Analytics

For the moment we have a simple google wrapper available that primarily is meant to set up two trackers (one for game, one for Fabrique) and allows you to send simple screenViews. The class itself is Called GoogleAnalytics but the lib exposes the property h5branding.google with an instance of this class.

First of all the analytics need to be setup:

h5branding.google.setup(
    'UA-436346-23', //The Analytics ID
    'My Games',     //The propery name
    'version-2'     //
);

After that you you can start sending screenviews. We use them to track a user's progress inside a game, and also to measure some KPI's

h5branding.google.sendScreenView('ScreenName');

// As a bonus you can also send Events:
h5branding.google.sendGenericEvent('Category', 'Action', 'Label');