
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
sidelines-utils
Advanced tools
This package will contain utils that will serve all the platforms in sidelines
The sidelines-utils package provides a collection of utility functions designed to enhance the efficiency and effectiveness of platform development within our company. It includes specialized functionalities for frontend development, such as deep linking and bet slip management.
npm i sidelines-utils
The FE module in sidelines-utils offers deep linking capabilities. Use FE.DeepLink.init to create a deep link builder which can be used to construct bet slips and manage offers.
const { FE } = require('sidelines-utils');
// Initialize the deep link builder
const deepLinkBuilder = FE.DeepLink.init('ios', deepLinkMap, deepLinkSettings, depth = Infinity);
/**
* Explanation of `FE.DeepLink.init` arguments:
*
* arguments[0] - platform: (string, required)
* The platform for which the deep link is being built.
* Acceptable values: 'ios' or 'android'.
*
* arguments[1] - deepLinkMap: (object, required)
* A map of deep links based on the user's location or context.
*
* arguments[2] - deepLinkSettings: (object, required)
* Settings that define how each deep link is constructed.
*
* arguments[3] - depth: (number, optional)
* The number of levels to search for offerings before stopping.
* Default value: Infinity.
*/
Creating and Managing Bet Slips
const newBetSlip = deepLinkBuilder('TEST_SESSIONID');
newBetSlip.add(betsApi[0], { line: 265.5, position: 'under' });
Deep Link Builder Functions
* deepLinkBuilder(id): //Creates a bet slip object for managing bets and offers.
* deepLinkBuilder(id).add(betApi, {line, position}):// Adds a bet with specified line and position.
* deepLinkBuilder(id).remove(betApi.id):// Removes a bet from the slip
* deepLinkBuilder(id).amount(amountOfMoney):// Set the amount of money user want to bet on the bet-slip
* deepLinkBuilder(id).clear():// Clears all bets and resets the amount, except for the ID.
* deepLinkBuilder(id).offers: //Retrieves an array of offers for the bet slip.
* deepLinkBuilder(id).availableOperators: //Retrieves an array of operator ids that are support in all bets for the bet slip.
Notes
const { DeepLink } = require('sidelines-utils');
const deepLinkSettingsBuilder = DeepLink.deepLinkSettings;
const settings = deepLinkSettingsBuilder()
.replace({
placeHolder: '{userName}',
key: 'userName',
global: true,
})
.replace({
placeHolder: '{values}',
key: 'values',
dataMethods: deepLinkSettingsBuilder()
.join({
keys: ['a', 'x', 'c'],
joinDelimiter: '-',
})
.build(),
joinDelimiter: ',',
})
.build();
const link = 'https://test.com/en/xports?options={values}&ui={userName}';
const data = {
userName: 'test',
values: [{ a: '1234', x: '555', c: '7878' }],
};
const resultLink = DeepLink.createDeepLink(data, link, settings) // "https://test.com/en/xports?options=1234-555-7878&ui=test";
we want to change the link 'https://test.com/en/xports?options={values}&ui={userName}' to look like this "https://test.com/en/xports?options=1234-555-7878&ui=test" how we doing it
replace:
key?: string;
value?: string | null;
dataMethods?: Array<ReplaceSetting | AddQueryParamsSetting | JoinSetting | MapSetting>;
joinDelimiter?: string;
placeHolder: string;
global?: boolean;
index?: number;
addQueryParams:
queryParams: Array<QueryParams>;
key: string;
QueryParams {
key: string;
val: string;
default: string | number;
valPrefix?: string;
valSuffix?: string;
}
join:
keys: string[];
joinDelimiter: string;
NOTE : join is only dataMethod and the target data is array
map:
key: string;
NOTE : map is only dataMethod and the target data is array
The build function will return you the array of settings that you could use in the createDeepLink function.
The DR module provides direct deep link creation only using built-in, encrypted constants. This utility provides the createDeepLink method for simple, direct deep link generation.
The DR utility provides:
createDeepLinkconst { DR } = require('sidelines-utils');
// Initialize with secret token
DR.init('your_secret_token_123');
Parameters:
secretToken (string, required): Secret token to decrypt built-in constants
// After initialization, create deep links directly
const deepLink = DR.createDeepLink(data, operatorName, platform, type);
Parameters:
data (object, required): Bet data object
values (array, required): Array of deep link values to processbetAmount (number, optional): Bet amount, defaults to 0operatorName (string, required): Operator name ('someOperator')platform (string, optional): Target platform, default: 'web'
type (string, optional): Deep link type, default: 'parlay'
const { DR } = require('sidelines-utils');
// Initialize with secret token
DR.init('your_secret_token_123');
// Example 1: Single bet on web platform
const singleBetData = {
values: [{ deepLink: 'bet_value_123' }],
betAmount: 100,
};
const singleBetLink = DR.createDeepLink(
singleBetData,
'aaa', // operator
'web', // platform
'single' // type
);
console.log('Single bet link:', singleBetLink);
// Example 2: Parlay bet on iOS
const parlayBetData = {
values: [{ deepLink: 'bet_value_123' }, { deepLink: 'bet_value_345' }],
betAmount: 250,
};
const parlayBetLink = DR.createDeepLink(
parlayBetData,
'bbb', // operator
'ios', // platform
'parlay' // type
);
# Encrypt production constants
npm run encrypt-constants
# Encrypt test constants
npm run encrypt-constants:test
Note: The encryption utility uses AES-256-CBC encryption with the provided secret token. Keep your secret tokens secure and never commit them to version control.
FAQs
This package will contain utils that will serve all the platforms in sidelines
We found that sidelines-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.