
Research
wget to Wipeout: Malicious Go Modules Fetch Destructive Payload
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
@sessionbox/toolkit
Advanced tools
Easily integrate Sessionbox's API and automation features into your project with our ready-to-use toolkit. Streamline profile and team management, proxy settings and automation workflows.
Before you begin, ensure you have met the following requirements:
Node.js: Make sure you have Node.js installed. This project requires a minimum Node.js version of 18.x or higher.
Selenium WebDriver: Selenium WebDriver is used as a peer dependency in this project. You will need to have it installed in your project separately. You can install it using:
npm install selenium-webdriver
Additionally, if you're using TypeScript, it's recommended to install the TypeScript typings for Selenium WebDriver:
npm install @types/selenium-webdriver
Install the package using npm:
npm install @sessionbox/toolkit
Or with yarn:
yarn add @sessionbox/toolkit
To begin, initialize the package by inserting your API key, which can be located in your Sessionbox One settings.
import { sessionBoxInit } from '@sessionbox/toolkit'
const {api, selenium} = await sessionBoxInit('your-api-key-here');
Once initialized, you can freely utilize any part of the package — such as the api and selenium automation — as long as your application is running and the provided API key is valid.
const profiles = api.listProfiles();
await selenium.openNewProfile('cloud', 'https://www.sessionbox.io')
listProfiles
Returns a list of all Sessionbox profiles.
A Promise that resolves to an array of Profile objects.
const profiles = await api.listProfiles();
getProfile
Return a Sessionbox profile by ID.
profileId: string
A Promise
that resolves to the Profile
object corresponding to the provided ID.
const profile = await api.getProfile('some-profile-id');
createProfile
Creates a new Sessionbox profile with specified attributes.
color: ColorNames
group: string
name: string
url: string
storageType: 'local' | 'cloud'
cookies: Cookie[]
A Promise
that resolves to the newly created Profile
object.
const newProfile = await api.createProfile(color, group, name, url, storageType, cookies);
updateProfile
Updates a Sessionbox profile by ID.
profileId: string
color: ColorNames
group: string | undefined
name: string | undefined
sbProxyId: string | undefined
url: string | undefined
A Promise
that resolves once the profile is successfully updated.
import { ColorNames } from '@sessionbox/toolkit';
await api.updateProfile('some-profile-id', ColorNames.BLUE, 'My Group', 'My Profile', 'proxy-id', 'https://www.sessionbox.io);
deleteProfile
Deletes a Sessionbox profile by ID.
profileId: string
A Promise
that resolves once the profile is deleted.
await api.deleteProfile('some-profile-id');
createActionToken
Returns an action token.
action: 'cloud' | 'local' | 'temp' | 'open'
profileId?: string
url?: string
A Promise
that resolves to the created action token.
const actionToken = await api.createActionToken('some-action', 'some-profile-id', 'some-url');
addProxy
Adds a proxy to Sessionbox.
name: string
type: string
username: string
password: string
ip: string
port: string
teamId?: string
A Promise
that resolves to whatever is returned when a proxy is added.
await api.addProxy(name, type, username, password, ip, port, teamId);
listProxies
Lists all proxies in Sessionbox.
A Promise
that resolves to a list of all proxies.
const proxies = await api.listProxies();
removeProxy
Deletes a proxy in Sessionbox by ID.
proxyId: string
A Promise
that resolves once the proxy is removed.
await api.removeProxy('some-proxy-id');
listTeams
Lists all teams in Sessionbox.
A Promise
that resolves to a list of all teams.
const teams = await api.listTeams();
createSessionboxDriver
Generates a Selenium WebDriver with Sessionbox One extension integration.
options?: Options
Returns a Promise that resolves to a SeleniumDriver once the extension is downloaded.
await selenium.openExistingProfile(options);
openNewProfile
Opens a new Sessionbox profile.
storageType: 'cloud' | 'local' | 'temp'
url: string
driver?: SeleniumDriver
A promise that resolves once the profile has been created and the desired URL has been opened in the browser.
await selenium.openNewProfile('cloud', 'https://www.google.com);
openExistingProfile
Opens an existing Sessionbox profile.
profileId: string
driver?: SeleniumDriver
A promise that resolves once the existing profile has been opened and the desired URL has been loaded in the browser.
await selenium.openExistingProfile('profile-id');
import { sessionBoxInit } from '@sessionbox/toolkit';
import { By } from 'selenium-webdriver';
(async () => {
const apiKey = 'your-api-key';
const { api, selenium } = await sessionBoxInit(apiKey);
const sessionBoxDriver = await selenium.createSessionBoxDriver();
let driver;
try {
driver = await selenium.openNewProfile('temp', 'https://www.sessionbox.io', sessionBoxDriver);
// Continue to interact with the driver as needed, such as navigating to other URLs or performing DOM manipulations
await driver.get('https://www.github.com');
const signInButton = await driver.findElement(By.xpath('//a[text()="Sign in"]'));
await signInButton.click();
const usernameField = await driver.findElement(By.id('login_field'));
await usernameField.sendKeys('your-github-username');
} catch (error) {
console.error('An error occurred:', error);
} finally {
await sessionBoxDriver.quit();
if (driver) {
await driver.quit();
}
}
})();
import { sessionBoxInit } from '@sessionbox/toolkit';
(async () => {
const apiKey = 'your-api-key';
const { api, selenium } = await sessionBoxInit(apiKey);
const profiles = await api.listProfiles();
const profileIds = profiles.map(profile =>
{return profile.id
})
const sessionBoxDriver = await selenium.createSessionBoxDriver();
let drivers: any;
try {
const drivers = await Promise.all(profileIds.map(async(profileId) => {
return await selenium.openExistingProfile(profileId, sessionBoxDriver);
}))
console.log(drivers)
drivers[0].get("https://www.github.com");
} catch (error) {
console.error('An error occurred:', error);
} finally {
await sessionBoxDriver.quit();
if (drivers) {
drivers.map(async(driver: any) => {
driver.quit();
})
}
}
})();
We've included a ColorNames
enum to help you manage various color names consistently in your code. Here are the available color options:
ColorNames.RED
ColorNames.PINK
ColorNames.PURPLE
ColorNames.DEEP_PURPLE
ColorNames.INDIGO
ColorNames.LIGHT_BLUE
ColorNames.CYAN
ColorNames.TEAL
ColorNames.GREEN
ColorNames.LIGHT_GREEN
ColorNames.LIME
ColorNames.YELLOW
ColorNames.AMBER
ColorNames.ORANGE
ColorNames.DEEP_ORANGE
ColorNames.BROWN
ColorNames.GREY
ColorNames.BLUE_GREY
We've defined a StorageType
enum to make it easy for you to work with different storage options. Here are the available storage types:
StorageType.CLOUD
: Cloud storage.StorageType.LOCAL
: Local storage.StorageType.TEMP
: Temporary storage.StorageType.OPEN
: You can pass StorageType.OPEN
as a parameter to createActionToken to create and action token for existing profiles.To work with cookies, we provide a Cookie
interface with the following properties:
name
- requiredvalue
- requireddomain
expirationDate
hostOnly
httpOnly
path
sameSite
secure
session
To manage user profiles, we provide a Profile
interface with the following properties:
id
: A unique identifier for the profile.teamId
: The team ID associated with the profile.launchUrl
: The URL to launch when this profile is loaded.name
: The name of the profile.color
: The color associated with the profile.group
: The group to which the profile belongs.icon
: The icon representing the profile.You can use this interface to create, update, and manage user profiles within your application.
ISC
FAQs
A SessionBox toolkit for developers.
The npm package @sessionbox/toolkit receives a total of 1 weekly downloads. As such, @sessionbox/toolkit popularity was classified as not popular.
We found that @sessionbox/toolkit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.
Product
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.