gologin
v2.1.33
Published
A high-level API to control Orbita browser over GoLogin API
Readme
GoLogin Node.js SDK
This package provides functionality to run and stop GoLogin profiles with node.js and then connect the profiles to automation tools like Selenium, Puppetteer, Playwright etc.
How does it work?
- You give SDK your dev token and profile id that you want to run
- SDK takes care of downloading, preparing your profile and starts the browser
- SDK gives you websocket url for automation tools
- You take this websocker url and connect it to the automation tool on your choice: Puppetteer, Selenium, Playwright etc
- Automation tool connects to browser and you can manage it through code
Getting Started
Where is token? API token is here.

Installation
npm i gologin
Example
import { GologinApi } from './src/gologin-api.js';
const GL = GologinApi({
token: 'your token',
});
const profile = await GL.createProfileRandomFingerprint('some name');
const profileId = profile.id;
await GL.addGologinProxyToProfile(profileId, 'us');
const browser = await GL.launch({ profileId });
const page = await browser.newPage();
await page.goto('https://linkedin.com');
await new Promise((resolve) => setTimeout(resolve, 5000));
await browser.close();
await GL.stop();Methods
constructor
Required options:
token<[string]> Required - your API token
Optional options:
profile_id<[string]> - profile ID (NOT PROFILE NAME) will be generated if not specifiedexecutablePath<[string]> path to executable Orbita file. Orbita will be downloaded automatically if not specifiedextra_paramsarrayof <[string]> additional flags for browser start. For example: '--headles', '--load-extentions=path/to/extension'uploadCookiesToServer<[boolean]> upload cookies to server after profile stopping (default false). It allows you to export cookies from api later.writeCookesFromServer<[boolean]> if you have predefined cookies and you want browser to import it (default true).tmpdir<[string]> absolute path to the directtory where you want to store user-data-dir. Default path in tmp folder will be picked if no specifiedvncPort<[integer]> port of VNC server if you using it
const GL = new GoLogin({
token: 'your token',
profile_id: 'profile id',
extra_params: ["--headless", "--load-extentions=path/to/extension"]
});createProfileRandomFingerprint - you pass os ('lin', 'win', 'mac') and profile name and we give you brand new shiny profile
const GL = new GoLogin({
token: 'your token',
profile_id: 'profile id',
extra_params: ["--headless", "--load-extentions=path/to/extension"]
});
const profile = await gl.createProfileRandomFingerprint("some name")
const profileId = profile.idcreateProfileWithCustomParams - This method creates a profile and you can pass any particular params to it. Full list of params you can find here - https://api.gologin.com/docs
const GL = GoLogin({
"token": "your token",
})
const profile = await gl.createProfileWithCustomParams({
"os": "lin",
"name": "some name",
"navigator": {
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
"resolution": "1920x1080",
"language": "en-US",
"platform": "Linux x86_64",
"hardwareConcurrency": 8,
"deviceMemory": 8,
"maxTouchPoints": 0
}
})
const profileId = profile.idupdateUserAgentToLatestBrowser - user agent is one of the most important thing in your fingerprint. It decides which browser version to run. This method help you to keep useragent up to date.
const GL = GoLogin({
"token": "your token",
})
await GL.updateUserAgentToLatestBrowser(["profineId1", "profileId2"], "workspceId(optional)")addGologinProxyToProfile - Gologin provides high quality proxies with free traffic for paid users. Here you can add gologin proxy to profile, just pass country code
const GL = GoLogin({
"token": "your token",
})
await GL.addGologinProxyToProfile("profileId", "us")addCookiesToProfile - You can pass cookies to the profile and browser will import it before starting
const GL = GoLogin({
"token": "your token",
})
await GL.addCookiesToProfile("profileId", [
{
"name": "session_id",
"value": "abc123",
"domain": "example.com",
"path": "/",
"expirationDate": 1719161018.307793,
"httpOnly": True,
"secure": True
},
{
"name": "user_preferences",
"value": "dark_mode",
"domain": "example.com",
"path": "/settings",
"sameSite": "lax"
}
])refreshProfilesFingerprint - Replaces your profile fingerprint with a new one
const GL = GoLogin({
"token": "your token",
})
await GL.refreshProfilesFingerprint(["profileId1", "profileId2"])changeProfileProxy - allows you to set a proxy to a profile
const GL = GoLogin({
"token": "your token",
})
await GL.changeProfileProxy("profileId", { "mode": "http", "host": "somehost.com", "port": 109, "username": "someusername", "password": "somepassword"})launch() - starts browser with profile id, returning WebSocket url for puppeteer
const GL = GoLogin({
"token": "your token",
})
await GL.launch({ profileId: 'some profileId' })exit() stops browser and uploads it to the storage
const GL = GoLogin({
"token": "your token",
})
await GL.launch({ profileId: 'some profileId' })
await GL.exit()DEBUG
For debugging use DEBUG=* node example.js command
Selenium
To use GoLogin with Selenium see selenium/example.js
Full GoLogin API
Gologin Api Documentation
Python support
pyppeteer (recommend) and Selenium supported (see file gologin.py)
for Selenium may need download webdriver
Privacy
Our full privacy policy you can finde here
