This is a TypeScript automation tool that helps you log in to WeWork, navigate to the desk booking page, and check availability for specific dates at your preferred location. It can also send Slack notifications with availability information.
- Automated login to WeWork
- Navigation to desk booking page
- Selection of preferred location
- Checking desk availability for next Tuesday and Thursday
- Slack notifications with availability results
- Option to run on a second display (for Mac users)
- Configurable screenshot settings
- Detailed console output of availability status
- Node.js (v14 or higher)
- npm (v6 or higher)
- A WeWork account
- (Optional) A Slack workspace with webhook URL for notifications
-
Clone this repository:
git clone <repository-url> cd wework-automation -
Install dependencies:
npm install -
Create a
.envfile in the root directory with your configuration:# See the Configuration section below for all available options WEWORK_EMAIL=your_email@example.com WEWORK_PASSWORD=your_password LOCATION_NAME="Your Preferred Location"
-
Build the TypeScript code:
npm run build -
Run the automation:
npm startOr run in development mode:
npm run dev
- The script launches a Puppeteer browser instance
- Logs in to WeWork using your credentials
- Navigates to the desk booking page
- Checks availability for the next Tuesday and Thursday:
- Selects your preferred location
- Navigates to each date
- Checks if desks are available and how many
- Sends a Slack notification with the results (if configured)
- Outputs a summary to the console
All configuration is done through environment variables in the .env file. Here's a complete list of available options:
# WeWork Login Credentials
WEWORK_EMAIL=your_email@example.com
WEWORK_PASSWORD=your_password
# WeWork Location
LOCATION_NAME="Your Preferred Location"
# Set to 'true' for headless mode (no browser UI)
HEADLESS=false
# Slow down operations by this many milliseconds (useful for debugging)
SLOW_MO=50
# Default timeout for operations in milliseconds
DEFAULT_TIMEOUT=30000
# Timeout specifically for login operations
LOGIN_TIMEOUT=60000
# Set to 'true' to logout after completing the automation
LOGOUT_AFTER_COMPLETION=false
# Directory to save screenshots (relative to project root)
SCREENSHOTS_DIR=./screenshots
# Set to 'false' to disable taking screenshots during automation
ENABLE_SCREENSHOTS=true
# Webhook URL for sending notifications to Slack
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR_WEBHOOK_URL
# Set to 'true' to use the second display
USE_SECOND_DISPLAY=false
# Optional: Specific window position (x,y coordinates) as JSON
# WINDOW_POSITION={"x":2000,"y":100}
When Slack integration is configured, the automation will send a single message containing:
- Availability status for each date checked
- Number of available desks (when known)
- A link to the WeWork login page to quickly book a desk
To set up Slack notifications:
- Create a Slack App in your workspace
- Enable Incoming Webhooks
- Create a webhook for the channel where you want to receive notifications
- Add the webhook URL to your
.envfile
For Mac users who want to run the automation on a second display:
- Set
USE_SECOND_DISPLAY=truein your.envfile - Optionally, specify the exact position with
WINDOW_POSITION={"x":2000,"y":100} - Adjust the x,y coordinates based on your specific display arrangement
- The automation is configured to check the next Tuesday and Thursday by default
- Screenshots are saved to help with debugging and verification
- You can disable screenshots to save disk space by setting
ENABLE_SCREENSHOTS=false - The browser window position defaults to coordinates that work for most second displays (x:2000, y:100)
This tool is for personal use only. Please respect WeWork's terms of service and use this responsibly.
MIT