Username to login with
Whether or not the client is ready to move around and perform actions.
The internal Hazel socket. This is exposed in case you want to do things like sending raw packets or disconnecting.
This symbol shall be used to install a listener for only monitoring 'error'
events. Listeners installed using this symbol are called before the regular
'error'
listeners are called.
Installing a listener using this symbol does not change the behavior once an
'error'
event is emitted, therefore the process will still crash if no
regular 'error'
listener is installed.
Connect to a port and ip address. This also performs a handshake to properly initialize the version and username.
If you don't know what server to connect to, get an ip from the matchmakingServers
export from @among-js/data
and use 22023 as a port. You may also want to consider setting up a local Impostor
server for testing without putting load on the official servers.
Port
Ip address
Join an Among Us game, and handle join errors as well as redirects.
**This only connects! To get an avatar, receive events, and move around
you must use the spawn
function.`
Game code to join, as a string
Send a ready packet. This took years to implement so please use carefully.
Spawn the player with an avatar and username, and begin emitting events.
The color to spawn with, from @among-js/data
Generated using TypeDoc
Simple and clean wrapper for making Among Us clients and bots.
If you're reading this through TypeDoc, I highly recommend unchecking "Inherited" in the top right corner. It'll make it so you only have to see the methods and properties that are pertinent to Among JS.
import { AmongUsSocket } from '@among-js/sus' import { PlayerColor, matchmakingServers } from '@among-js/data' const socket = new AmongUsSocket('testing') await socket.connect(22023, matchmakingServers.NA[1]) await socket.joinGame('ABCDEF') await socket.spawn(PlayerColor.Lime)