You can pass your BambooHR API token and company domain directly to the methods, or use environment variables:
Required:
BAMBOOHR_TOKEN — Your BambooHR API token
BAMBOOHR_COMPANY_DOMAIN — Your BambooHR company domain (the part before .bamboohr.com)
BAMBOOHR_EMPLOYEE_ID — Your BambooHR employee ID
Creating a BambooHR API Token
To use this library, you'll need to create a BambooHR API token:
Log in to your BambooHR account
Click on your profile picture in the bottom-left corner
Select "API Keys" from the dropdown menu
Click "Add New Key"
Enter a API Key Name for your key (e.g., "MCP Server"), and click "Generate Key"
Copy the generated token immediately (it will only be shown once)
Finding Your Company Domain
Your company domain is the subdomain used in your BambooHR URL:
If you access BambooHR at https://yourcompany.bamboohr.com, then your company domain is yourcompany
This value should be used for the BAMBOOHR_COMPANY_DOMAIN environment variable or passed directly to the API methods
Getting Your Employee ID
You can find your employee ID in several ways:
From your profile URL: When viewing your profile, the URL will contain your employee ID (e.g., https://yourcompany.bamboohr.com/employees/employee.php?id=123)