Skip to main content
Get started with BundleUp in a Rails application. This guide walks you through creating an authorization flow to connect a third-party service (GitHub in this example) and then uses that connection to fetch API data via BundleUp’s unified API. By the end of this guide, you’ll:
  • Redirect a user through an OAuth-style authorization flow
  • Receive a connection_id
  • Use that connection_id server-side with the Ruby SDK to fetch data

Prerequisites

Before you begin, make sure you have:
  • A BundleUp account
  • A BundleUp API key (server-side)
  • Your BundleUp Client ID (used for authorization redirects)
  • An Integration ID for the service you want to connect (for example, github)
  • Ruby 2.7+ and Rails installed
You can find your API key, Client ID, and Integration IDs in the BundleUp dashboard.

Step 1: Create a new Rails app

Create a fresh Rails project:
This scaffolds a Rails app you can run locally.

Step 2: Install the BundleUp Ruby SDK

Add the bundleup-sdk gem to your Gemfile:
Then install dependencies:
This makes the BundleUp client available to your Rails app.

Step 3: Configure environment variables

Create a .env file (or use your preferred secrets manager) with:
.env
Make sure your Rails app loads these variables (for example via dotenv-rails or Rails credentials).

Step 4: Add routes

In config/routes.rb, define the home and callback endpoints:
config/routes.rb
In app/controllers/home_controller.rb, add:
app/controllers/home_controller.rb
Then create simple views.
app/views/home/index.html.erb
This link sends the user to BundleUp’s auth server to authorize the integration.

Step 6: Handle the callback and fetch data

Update callback action in HomeController:
app/controllers/home_controller.rb
Then update app/views/home/callback.html.erb:
app/views/home/callback.html.erb
Now, after a successful authorization redirect, you use the connection_id to fetch a unified API resource using the Ruby SDK.

Step 7: Run your application

Start the Rails server:
Visit http://localhost:3000, click Connect GitHub, authorize the app, and then you’ll see data fetched through BundleUp.

What’s next?

  • Persist connection_id to your database for later use
  • Add authenticated views that use the Ruby SDK to fetch user data
  • Support additional integrations with no auth changes