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

helika-sdk

v0.3.2

Published

The Helika SDK is for developers to be able to make API calls to the Helika DEV and PROD endpoints.

Downloads

1,128

Readme

Helika User Acquisition SDK

SDK for use with the Events endpoints (https://api.helika.io/v1 or https://api-stage.helika.io/v1)

The Helika SDK is for developers to be able to make API calls to the Helika DEV and PROD endpoints. The following pages will describe how to make calls to the Helika API. Developers will need to install the helika-sdk to their project.

Installation

npm i helika-sdk

Usage

API KEY

An API Key is required to use the SDK.

For an Events SDK Instance, an API Key from Helika is required. Please reach out to your Helika contact or inquiring through https://www.helika.io/contact/ .

Base URL

The SDK can send to DEV or PROD endpoints depending on the Base URLs to the sdk on instance creation (see step 1 in Instance Creation section).

EventsBaseURL

  • EVENTS_DEV
  • EVENTS_PROD

Use the EventsBaseURL enum for Helika.Events

For Development, use EVENT_DEV. This sends the events and queries to the develop environments.

For Production, use EVENT_PROD. This sends the events and queries to the production environments.

Quick Start

Event Example:

import Helika from "helika-sdk"
import { EventsBaseURL } from "helika-sdk"

const gameId = 'my_game_name'
const helikaSDK = new Helika.EVENTS(api_key, gameId, EventsBaseURL.EVENTS_DEV);

// PII Tracking is set to True by default. You can turn it off by setting the last parameter on the Helika.Events
// constructor to 'false' as shown below.
// const helikaSDK = new Helika.EVENTS(api_key, gameId, EventsBaseURL.EVENTS_DEV, false);

// Optional - if you want to disable Personal Identifiable Information Tracking due to compliance
helikaSDK.setPIITracking(false);
helikaSDK.setAppDetails({
    platform_id: 'mySDK', //optional
    client_app_version: '1.0.0',//optional
    store_id: 'steam',//optional
    source_id: 'facebook',//optional
    server_app_version: '1.0.0', //optional, if from client server, not client app
})

// To clear AppDetails, pass an empty object to `helikaSDK.setAppDetails()`
// helikaSDK.setUserDetails({});

/*
REQUIRED if sending userEvents, else OPTIONAL
If userDetails is not set, we autogenerate an anonymous id to the user. When you update the userDetails via setUserDetails(), we'll automatically associate the anonymous id to the user_id.

Include any user identifying information that you'd like to keep track of such as any emails, wallet addresses, player_id, group_id, usernames, etc.
*/
helikaSDK.setUserDetails({
	user_id: '123456',
	email: '[email protected]',
	wallet_id: '0x4kd....'
})

// To clear UserData, pass an object to `helikaSDK.setUserDetails()` and set user_id to null
// helikaSDK.setUserDetails({user_id=null});

// Start a session/create a new session which initiates the SDK instance with a
// sessionId which is required to fire events. This should only be called when 
// the user lands on the page. We store and re-use the session_id from the local
// storage, if present.
await helikaSDK.startSession();

events = [{
	event_type: 'win_event',
	event: {
		user: 'user_1',
		win_number: 1,
		wallet: '0x4kd....'
	}
}]

userEvents = [{
	event_type: 'user_play_game',
	event: {
		user: 'user_1',
		win_number: 1,
		wallet: '0x4kd....'
	}
}]

// Asynchronously
// await helikaSDK.createEvent(events);

helikaSDK.createEvent(events)
.then((resp) => {
	//do something...
	// console.log(resp);
}).catch(e => {
	console.error(e);
});

helikaSDK.createUserEvemt(userEvents)
.then((resp) => {
	//do something...
	// console.log(resp);
}).catch(e => {
	console.error(e);
});

Full docs

For the full documentation, please head to official docs.