Installation & Setup
Install the monday_ruby gem and configure your development environment.
Requirements
- Ruby 2.7 or higher
- A monday.com account
- A monday.com API token
Check your Ruby version:
bash
ruby -vInstall the Gem
Using Bundler (Recommended)
Add to your Gemfile:
ruby
gem 'monday_ruby'Install:
bash
bundle installUsing RubyGems
Install directly:
bash
gem install monday_rubyVerify installation:
bash
gem list monday_rubyYou should see monday_ruby with the version number.
Get Your API Token
- Log in to your monday.com account
- Click your profile picture in the top-right corner
- Select Administration
- Go to the Connections section
- Select Personal API token in the sidebar
- Copy your token
Configure the Client
Option 1: Environment Variables (Recommended)
Create a .env file in your project root:
bash
MONDAY_TOKEN=your_token_hereLoad it in your application:
ruby
require "monday_ruby"
require "dotenv/load"
Monday.configure do |config|
config.token = ENV["MONDAY_TOKEN"]
endInstall the dotenv gem:
bash
gem install dotenvOr add to your Gemfile:
ruby
gem 'dotenv'Option 2: Direct Configuration
Configure globally:
ruby
require "monday_ruby"
Monday.configure do |config|
config.token = "your_token_here"
endSecurity
Never commit API tokens to version control. Always use environment variables or secure credential storage.
Option 3: Per-Client Configuration
Pass token when creating the client:
ruby
client = Monday::Client.new(token: "your_token_here")Verify Setup
Test your configuration:
ruby
require "monday_ruby"
Monday.configure do |config|
config.token = ENV["MONDAY_TOKEN"]
end
client = Monday::Client.new
response = client.boards
if response.success?
puts "Connected successfully!"
puts "Found #{response.body.dig('data', 'boards').length} boards"
else
puts "Connection failed: #{response.code}"
endRun this script. If you see "Connected successfully!", you're ready to go.
Configuration Options
API Version
Specify the monday.com API version:
ruby
Monday.configure do |config|
config.token = ENV["MONDAY_TOKEN"]
config.version = "2024-10"
endDefault version: 2024-01
API Host
Override the API endpoint (rarely needed):
ruby
Monday.configure do |config|
config.token = ENV["MONDAY_TOKEN"]
config.host = "https://api.monday.com/v2"
end