A comprehensive PayloadCMS plugin that integrates with Greenhouse ATS (Applicant Tracking System) to manage job listings directly within your Payload admin dashboard.
- Job Management: View and manage Greenhouse job listings directly in Payload admin
- Real-time Sync: Fetch job data from Greenhouse API with automatic validation
- Dashboard Widget: Beautiful dashboard interface showing job statistics and quick actions
- Debug Tools: Built-in debugging endpoints for troubleshooting API connections
- Multiple Display Types: Support for accordion and cycle view layouts
- Customizable Forms: Support for both iframe and inline application forms
- Department Organization: Jobs organized by offices and departments
- Location Filtering: Filter jobs by location and office
- TypeScript Support: Full TypeScript definitions included
- Caching System: Configurable cache expiration for optimal performance
- Error Handling: Comprehensive error handling and logging
- Flexible Configuration: Multiple configuration options for different use cases
npm install payload-greenhouse
# or
yarn add payload-greenhouse
# or
pnpm add payload-greenhouseSet up your environment variables in .env:
GREENHOUSE_URL_TOKEN=your_greenhouse_url_token
GREENHOUSE_API_KEY=your_greenhouse_api_key # Optional, required for inline formsAdd the plugin to your Payload configuration:
// payload.config.ts
import { buildConfig } from 'payload'
import { payloadGreenhouse } from 'payload-greenhouse'
export default buildConfig({
// ... your other config
plugins: [
payloadGreenhouse({
urlToken: process.env.GREENHOUSE_URL_TOKEN,
apiKey: process.env.GREENHOUSE_API_KEY, // Optional
}),
],
})payloadGreenhouse({
// Required: Your Greenhouse URL token
urlToken: process.env.GREENHOUSE_URL_TOKEN,
// Optional: API key for inline application forms
apiKey: process.env.GREENHOUSE_API_KEY,
// Board display type: 'accordion' or 'cycle'
boardType: 'accordion',
// Form integration type: 'iframe' or 'inline'
formType: 'iframe',
// Cache expiration time in seconds (default: 3600 = 1 hour)
cacheExpiryTime: 3600,
// Transition effect for cycle view
cycleFx: 'fade', // 'fade' | 'fadeout' | 'none' | 'scrollHorz'
// Enable debug mode for additional logging
debug: true,
// Disable the plugin entirely
disabled: false,
// Disable the dashboard widget
disableDashboard: false,
// Add Greenhouse job board to specific collections
collections: {
posts: true,
pages: true,
},
})- Navigate to Admin Dashboard: Open your Payload admin panel
- Greenhouse Jobs Section: Find the "Greenhouse Jobs" collection under "Integrations"
- Add New Job: Click "Create New" and enter a valid Greenhouse Job ID
- Auto-sync: Job details will be automatically fetched and populated from Greenhouse
When you add a job, the following fields are automatically populated:
| Field | Description | Source |
|---|---|---|
jobId |
Greenhouse Job ID | User input (validated) |
title |
Job title | Greenhouse API |
location |
Job location | Greenhouse API |
department |
Department name | Greenhouse API |
office |
Office location | Greenhouse API |
publishedDate |
Publication date | Greenhouse API |
updatedAt |
Last update timestamp | Auto-generated |
absoluteUrl |
Direct application link | Greenhouse API |
content |
Job description | Greenhouse API |
companyName |
Company name | Greenhouse API |
requisitionId |
Internal requisition ID | Greenhouse API |
internalJobId |
Internal job identifier | Greenhouse API |
The plugin adds a dashboard widget that displays:
- Total number of available jobs
- Quick statistics by department and office
- Recent job updates
- Quick access to add new jobs
- Debug information (when enabled)
The plugin exposes several API endpoints:
Fetch all available jobs from Greenhouse
// Example response
;[
{
id: 12345,
title: 'Senior Software Engineer',
department: 'Engineering',
office: 'San Francisco',
location: 'San Francisco, CA',
absoluteUrl: 'https://boards.greenhouse.io/company/jobs/12345',
updatedAt: '2024-01-15T10:30:00Z',
},
]Submit job applications (requires API key)
Clear the job cache
Debug endpoint for troubleshooting API connections
// Example response
{
"success": true,
"totalJobs": 25,
"availableJobIds": [12345, 12346, 12347],
"jobDetails": [
{
"id": 12345,
"title": "Senior Software Engineer",
"department": "Engineering",
"office": "San Francisco"
}
]
}You can add Greenhouse job board functionality to existing collections:
payloadGreenhouse({
collections: {
posts: true, // Add to posts collection
pages: true, // Add to pages collection
projects: true, // Add to projects collection
},
})This adds a greenhouseJobBoard field group to the specified collections with options to:
- Enable/disable job board for individual documents
- Override the default board type per document
src/
βββ index.ts # Main plugin configuration
βββ components/ # React components
β βββ BeforeDashboardServer.tsx # Server-side dashboard component
β βββ BeforeDashboardClient.tsx # Client-side dashboard component
β βββ BeforeDashboardClient.module.css # Styles
βββ utils/ # Utility functions
β βββ greenhouseApi.ts # Greenhouse API integration
βββ exports/ # Export definitions
βββ client.ts # Client-side exports
βββ rsc.ts # React Server Components exports
# Install dependencies
pnpm install
# Build the plugin
pnpm build
# Development mode
pnpm dev
# Run tests
pnpm test
# Lint code
pnpm lintThe plugin includes comprehensive tests:
# Run all tests
pnpm test
# Run with coverage
pnpm test --coverage
# Run specific test file
pnpm test integration.test.ts- Ensure
GREENHOUSE_URL_TOKENenvironment variable is set - Verify the token is valid in the Greenhouse dashboard
- Use the
/api/greenhouse/debugendpoint to see available job IDs - Ensure the job is published and active in Greenhouse
- Check that your URL token has proper permissions
- For inline forms, ensure
GREENHOUSE_API_KEYis set correctly
Enable debug mode for additional logging:
payloadGreenhouse({
debug: true,
// ... other options
})Test your Greenhouse connection:
curl http://localhost:3000/api/greenhouse/debugMIT License - see LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/payload-greenhouse.git - Install dependencies:
pnpm install - Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes and add tests
- Run tests:
pnpm test - Submit a pull request
- GitHub Issues: Create an issue
- Documentation: Check this README and inline code comments
- Community: Join the PayloadCMS Discord community