Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@arkadiuminc/sdk

Package Overview
Dependencies
Maintainers
8
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arkadiuminc/sdk - npm Package Compare versions

Comparing version 0.0.38 to 0.0.39

dist/pkg/api/features/analytics/analytics.api.test.d.ts

174

dist/pkg/api/features/analytics/analytics.api.d.ts
import { RpcProvider } from '../../core/rpc';
import { GameIdReaderContract } from '../environment/environment.api';
import { AnalyticProviderEnum, IAnalyticConfig } from './defs';
import { DimensionsObject } from './dimensions';
interface EnvironmentVersion {
GameKey: string;
GameVersion: string;
NestVersion: string;
SdkVersion: string;
gameKey: string;
gameVersion: string;
nestVersion: string;
sdkVersion: string;
}

@@ -13,2 +15,6 @@ export interface AnalyticsApiContract {

getEnvVersion(): Promise<EnvironmentVersion>;
configureProvider(config: IAnalyticConfig): Promise<void>;
sendEvent(eventCategory: string, eventAction: string, dimensions: DimensionsObject): Promise<void>;
sendPageView(pageName: string, dimensions: DimensionsObject): Promise<void>;
trackException(exception: Error): Promise<void>;
}

@@ -18,10 +24,20 @@ export declare class AnalyticsApi implements AnalyticsApiContract {

private rpcProvider;
private providers;
private activeProvidersTypes;
private info;
constructor(gameReader: GameIdReaderContract, rpcProvider: RpcProvider);
getEnvVersion(): Promise<EnvironmentVersion>;
private info;
setGameVersion(v: string): Promise<void>;
setNestVersion(v: string): Promise<void>;
configureProvider(config: IAnalyticConfig): Promise<void>;
sendEvent(eventCategory: string, eventAction: string, dimensions: DimensionsObject): Promise<void>;
sendPageView(pageName: string, dimensions: DimensionsObject): Promise<void>;
trackException(exception: Error): Promise<void>;
}
export declare class AnalyticsApiProxy implements AnalyticsApiContract {
private rpcProvider;
CONSOLE: AnalyticProviderEnum;
APP_INSIGHTS: AnalyticProviderEnum;
GOOGLE: AnalyticProviderEnum;
private dimensionValues;
constructor(rpcProvider: RpcProvider);

@@ -31,3 +47,151 @@ setGameVersion(v: string): Promise<void>;

getEnvVersion(): Promise<EnvironmentVersion>;
configureProvider(config: IAnalyticConfig): Promise<void>;
/**
* Low level method to report an analytics event
* Likely you can use the helper methods for common events instead.
* @param eventCategory {Event}
* @param eventAction {string} optional action. values depend on the event category
* @param dimensions record with dimensions to report
*/
sendEvent(eventCategory: string, eventAction: string, dimensions: DimensionsObject): Promise<void>;
/**
* Low level method to report a page view
* Likely you can use the helper methods for common page views instead.
* @param pageName the page name to report
* @param dimensions record with dimensions to report
*/
sendPageView(pageName: string, dimensions: DimensionsObject): Promise<void>;
/**
* Use this method to report an exception back to analytics
* @param exception {Error} error to capture
*/
trackException(exception: Error): Promise<void>;
setDimensions(dimensions: DimensionsObject): void;
/**
* Start of the Game (after preroll ends)
*/
sendAppStartedEvent(dimensions?: DimensionsObject): void;
/**
* Loading ended, user can see Start button (after preroll ends)
*/
sendMainScreenReadyEvent(dimensions?: DimensionsObject): void;
/**
* actions:
* User clicked on Start Button [action 'Loaded' if user continued previous game, otherwise New]
*/
sendStartButtonClickedEvent(action: 'New' | 'Loaded', dimensions?: DimensionsObject): void;
/**
* User sees gameplay and are ready to make action
*/
sendGameplayReadyEvent(dimensions?: DimensionsObject): void;
/**
* User made first move (any click on the page)
*/
sendFirstMoveEvent(dimensions?: DimensionsObject): void;
/**
* User entered the first right answer (for word games or trivia games and other applicable games)
*/
sendFirstRightAnswerEvent(dimensions?: DimensionsObject): void;
/**
* User made first match (for match-3, mahjongg and other applicable games)
*/
sendFirsMatchEvent(dimensions?: DimensionsObject): void;
/**
* User made first shot (for shooters and other applicable games)
*/
sendFirsShotEvent(dimensions?: DimensionsObject): void;
/**
* Users started new Round (Level). First round is Round 1 (not 0) (applicable for games with evergreen logic, not infinite games - before Nest changes to gameplay)
*/
sendRoundEvent(dimensions?: DimensionsObject): void;
/**
* actions:
* - Finished - User successfully finished the Round (Level). First round is Round 1 (not 0) (applicable for games with evergreen logic, not infinite games - before Nest changes to gameplay)
* - Not_Finished - User didn't finish the Round (Level) successfully OR leaves the game OR skips the round OR Quit (applicable for games with evergreen logic, not infinite games - before Nest changes to gameplay) {if possible several lose scenarios, add reason dimension}
*
* dimensions:
* - reason: No_Moves | Time_Out
*/
sendRoundEndEvent(action: 'Finished' | 'Not_Finished', dimensions?: DimensionsObject): void;
/**
* actions:
*
* Win - User ended game because he wins ({Round} in Label only if game has it) (applicable for games with evergreen logic, not infinite games - before Nest changes to gameplay)
* Lose -User ended game because he loses or faces "No More Moves' situation ({Round} in Label only if game has it) (applicable for games with evergreen logic, not infinite games - before Nest changes to gameplay)
* Time_Out - User ended game because he runs of time ({Round} in Label only if game has it) (applicable for games with evergreen logic, not infinite games - before Nest changes to gameplay)
* New_Game - User ends game because he starts a new game: click on 'New Game', then click on 'Yes' ({Round} in Label only if game has it) (applicable for games with evergreen logic, not infinite games - before Nest changes to gameplay)
* Quit - User ends game because he quits a new game: click on 'Quit', then click on 'Yes' ({Round} in Label only if game has it) (applicable for games with evergreen logic, not infinite games - before Nest changes to gameplay)
* Restart - User starts the same game from the beginning again (mostly for Solitaire games): click on 'Restart', then click on 'Yes' ({Round} in Label only if game has it) (applicable for games with evergreen logic, not infinite games - before Nest changes to gameplay)
*/
sendGameEndEvent(action: 'Win' | 'Lose' | 'Time_Out' | 'New_Game' | 'Quit' | 'Restart', dimensions?: DimensionsObject): void;
/**
* User clicked on Reshuffle (for mahjonggs and other applicable games)
*/
sendReshuffleEvent(dimensions?: DimensionsObject): void;
/**
* User meet any type of errors
*
* expected dimensions:
* - reason
*/
sendErrorEvent(dimensions?: DimensionsObject): void;
/**
* Users comes back from menu and sees the same game session [in games with limited gameplay time only]
*/
sendGameScreenActionsEvent(dimensions?: DimensionsObject): void;
/**
* User turned sound on/off [for games where sound is a bar, and can be customized (e.g. 1/3 of max) - before Nest]
* User turned music on/off [for games where music is a bar, and can be customized to specific position (e.g. 1/3 of max)- before Nest]
*/
sendMenuActionsEvent(action: 'Sound_On' | 'Sound_Off' | 'Music_On' | 'Music_Off', dimensions?: DimensionsObject): void;
/**
* User turned sound on/off [for games where only on/off option is available - after Nest]
*/
sendSettingsEvent(dimensions?: DimensionsObject): void;
/**
* Clicks on Help button on Game_Screen or in the menu
*/
sendHelpEvent(dimensions?: DimensionsObject): void;
/**
* User saw the help pop up [if it appeared once per gameplay]
*/
sendHelpShownEvent(dimensions?: DimensionsObject): void;
/**
* User clicks on different button in help menu [if it appeared once per gameplay]
*/
sendHelpPageEvent(action: 'Next' | 'Prev', dimensions?: DimensionsObject): void;
/**
* Impression of FUE - tutorial [aplicable for multiple stages tutorial which appear in different places]
*/
sendFUEEvent(dimensions?: DimensionsObject): void;
/**
* User saw a sign in pop up (before Nest, sent by game. Should be missed if Nest implemented.)
* User logged in successfully  (before Nest, sent by game. Should be missed if Nest implemented.)
*/
sendSignInPopUpEvent(action: 'Proposed' | 'Success', dimensions?: DimensionsObject): void;
/**
* User saw a sign in pop up (after Nest, sent by Nest. Should be missed if Nest not implemented.)
*/
sendSignInClickedEvent(dimensions?: DimensionsObject): void;
/**
* User logged in successfully (returns with eagle id) (after Nest, sent by Nest. Should be missed if Nest not implemented.)
*/
sendSignInSucceededEvent(dimensions?: DimensionsObject): void;
/**
* 1st page = page with start button
*/
sendIntroScreenPageView(dimensions?: DimensionsObject): void;
/**
* Next page after user clicks on Start
*/
sendGameScreenPageView(dimensions?: DimensionsObject): void;
/**
* Game over page == every game end, except Quit
*/
sendGameOverPageView(dimensions?: DimensionsObject): void;
/**
* When player manually quits the game
*/
sendQuitConfirmedPageView(dimensions?: DimensionsObject): void;
}
export {};

@@ -26,2 +26,4 @@ import { ApiEnv, BackendApi, SessionStorageType } from './api/features/backend/backend.api';

export { ApiEnv };
export { Dimension } from './api/features/analytics/dimensions';
export { Event } from './api/features/analytics/events';
export declare class GameApi {

@@ -28,0 +30,0 @@ version: string;

8

package.json
{
"name": "@arkadiuminc/sdk",
"version": "0.0.38",
"version": "0.0.39",
"description": "",

@@ -30,2 +30,3 @@ "keywords": [],

"build:docs": "typedoc --out docs --theme default src/arkadium-game-sdk.ts",
"build-fast": "npm run build:game && npm run build:arena",
"build": "npm run build:pkg && npm run build:game && npm run build:arena && npm run build:docs",

@@ -58,3 +59,3 @@ "start": "rollup -c rollup.config.ts -w",

},
"testEnvironment": "node",
"testEnvironment": "jsdom",
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",

@@ -133,4 +134,5 @@ "moduleFileExtensions": [

"jsonpack": "^1.1.5",
"nanoid": "^5.0.4"
"nanoid": "^5.0.4",
"@microsoft/applicationinsights-web": "^3.0.4"
}
}

@@ -32,1 +32,10 @@ # Arkadium SDK

## Reference documents
- Analytics
- [App Insights](TODO)
- [Google Tag manager](TODO)
- [Standardized Spec for every game](https://arkadium.atlassian.net/wiki/spaces/DepartmentBusinessOperations/pages/23675756/Standardized+Spec+for+every+game+-+GA+AppInsights)
- [AppInsight stamper](https://arkadium.atlassian.net/wiki/spaces/PhoenixGames/pages/23993424/AppInsight+stamper)
- [Adaptive Sampling Implementation](https://arkadium.atlassian.net/wiki/spaces/PhoenixGames/pages/23897949/Adaptive+Sampling+Implementation)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc