Using custom scripts to dynamically customize account data
You can use arbitrary JavaScript to choose the user name, display name, summary, avatar, and password for the accounts you create. This can be useful if you want to create accounts in bulk.
Custom JavaScript
You can run any JavaScript code you want. Your code needs to return a function that will be called to generate the value. That function can be asynchronous.
Context & Environment
Your callback function will be called with the following arguments:
ctx
: The context object passed to the script.env
: The environment object passed to the script.
Context
The context object allows you to access the current account being created (eg the previously generated username or steam id).
Property | Description | Availability | Example |
---|---|---|---|
type | For which field the script is being run. | All | "username" |
user.username | The username of the account being created. | display name, real name, summary | "aciuqwnf8izwgqevbf8qhuf" |
user.password | The username of the account being created. | display name, real name, summary | "PIn0UHBWE=dfhue9fzguFEO" |
id | The steam ID of the account being created. | display name, real name, summary | "76561198000000000" |
account | The steam acocount that was created. | post | Account |
proxy | The proxy that was used to create the account | post | http://127.0.0.1 |
cookies | Session cookies for the account. | post | Cookie Jar |
headers | Base headers used for creating the account. | post | { "User-Agent": "Mozilla/5.0 ..." } |
accounts | The steam accounts being exported. | export | Array of Accounts |
Cookie Jar
The cookies
object contains a top-level property of the domain, and each
domain has a list of cookies. Each cookie has the following properties:
name
- The name of the cookie.value
- The value of the cookie.
The following cookies are extracted from the following domains:
steamLoginSecure
sessionid
sessionid may not be present depending on the domain and features enabled. (Eg
there wont be a sessionid for steam.tv
)
Domains:
store.steampowered.com
checkout.steampowered.com
steamcommunity.com
help.steampowered.com
steam.tv
Environment
The environment object allows you to access some useful functions and data.
counter(name)
- Increments a counter with the given name and returns the new value. The counter is stored on disk.fs.readFile(path: string): Promise<string>
- Reads a file from the special directory. If the content is not string safe, it will be a base64 encoded data URI.fs.writeFile(path: string, content: string): Promise<void>
- Writes a file to the special directory. If the content is a data URI, it will be base64 decoded.fs.deleteFile(path: string): Promise<void>
- Deletes a file from the special directory.fs.listFiles(): Promise<Array<string>>
- Lists all files in the special directory.fs.mkdir(path: string): Promise<void>
- Creates a directory in the special directory.http(proxy?: string): Promise<HTTPClient>
- Creates a new HTTP client, with an optional proxy.
File system access is limited to a special directory in the SAGE data directory.
HTTPClient
The HTTP client has the following methods:
request(url: string, options?: RequestInit): Promise<Response>
- Makes a request to the given URL with the given options.setCookie(domain: string, cookie: string, value: string)
- Sets a cookie for the given domain.getCookie(domain: string, cookie: string): string
- Gets a cookie for the given domain.close()
- Closes the HTTP client.
RequestInit
The RequestInit
object looks like:
method
- The HTTP method to use.headers
- An object with the headers to send. Object of key-value pairs.body
- The body of the request. Must be a string. For binary data, usedata:;base64,
URIs.
Response
The Response
object has the following properties:
status
- The HTTP status code.headers
- An object with the headers of the response.body
- The response body as a string. Usesdata:
URIs for binary data.
Phases
There are multiple phases during account generation where you can run your
custom scripts. The current phase is passed as the type
property in the
context object.
Generation phases
These phases are run when generating the account.
username
&password
run concurrently. They can run before or after the CAPTCHA is submitted, this depends on your “match email” setting.display name
,real name
,summary
&avatar
run concurrently. They run after the accoutn is already created.post
runs after the account is created and the full account object is available (including steam guard data).
You can see a mermaid diagram of the generation process here.
Export phase
This phase is run when exporting accounts.
Examples
Check our Discord server for more examples and community made scripts.
Sequential usernames
Random names
Using faker.js:
SteamID as name
This already exists as a built-in option, but here’s how you could do it in a custom script:
Random anime pfp
Uses the https://www.thiswaifudoesnotexist.net/ API to choose a random anime waifu.
Random pfp from a directory
This chooses a random image from the files/avatars
directory inside the
SAGE data directory.