Shopify App Development for Ruby Developers

Rails skills transfer well to Shopify apps, but authentication, GraphQL responses and webhook retries need different assumptions. Here is what to check in your first app.

Written by Technically reviewed by Jim Freeze · Reviewed

A merchant wants a daily report of products running low. For a Rails developer, that sounds straightforward: fetch records, apply a rule, send an email. Shopify app development adds a few questions before the first controller: whose store is this, what access has been granted, and what happens when the same update arrives twice?

Ruby gemstone and Shopify shopping bag beside a laptop displaying a merchant dashboard
Ruby on Rails meets Shopify app development.

Ruby remains a useful choice for that work. Your experience with models, background jobs and tests carries over. The adjustment is learning which decisions belong to your application and which are controlled by Shopify.

Keep the Rails habits that help

Start with one merchant task. A stock report needs settings, a scheduled job and a clear result. It does not need a local copy of every object in the store. Active Record can hold your app’s configuration and processing history while Shopify remains responsible for the commerce records.

For commissioned, client-facing work, agree on that boundary before estimating custom Shopify builds. A client may mean a theme adjustment, an internal reporting app or a product intended for many merchants. Each requires a different handover, maintenance budget and installation plan. Put those expectations in the brief.

Keep API calls in a small Ruby service object. Let controllers handle requests and jobs handle lengthy imports. Scope stored records to the authenticated shop, and test that one merchant cannot retrieve another merchant’s settings. Familiar Rails discipline helps here.

Choose the framework deliberately

Shopify recommends its React Router template for most new apps. That can surprise developers expecting a Rails scaffold because Shopify itself has strong Ruby roots. Ruby is still an option: the official Shopify App Rails engine supplies generators and authentication support for Rails applications.

Choose for the team that will maintain the application. Rails can be a sensible home for substantial Ruby business logic. However, an embedded admin interface also involves Shopify’s browser tooling and interface conventions. Do not assume every JavaScript tutorial maps directly onto an ERB view, or that using the Ruby template removes frontend work.

Check the selected template’s current setup instructions before following an older tutorial. Pin dependencies, record the API version and keep development credentials separate from production. A working starter screen is useful evidence that installation works; it says little about your eventual business workflow.

Separate browser identity from API access

An app embedded in Shopify admin cannot depend on an ordinary Rails session cookie being available across that boundary. Shopify’s App Bridge provides a short-lived ID token, previously called a session token. Your backend validates it; the API access token is a separate credential used to call Shopify.

Use the maintained authentication helpers instead of inventing a login flow. Never select a merchant’s credentials simply from an unverified shop parameter. Authentication must establish the store before your code loads its records or issues API requests.

Background work needs particular care. A report running overnight cannot depend on the merchant keeping a browser tab open. Use the appropriate offline access arrangement, handle token expiry where applicable, and request only the scopes the feature needs. Keep tokens out of logs and frontend code.

Read GraphQL responses all the way through

Use the GraphQL Admin API for new development. The REST Admin API is legacy, and old examples built around REST resources can teach the wrong starting point. Query the fields needed for the report and follow cursor pagination; the first page is not the complete catalogue.

The GraphQL Admin API reference explains a crucial difference: HTTP 200 can still accompany errors. Inspect top-level errors and request mutation userErrors where available. A successful network exchange does not establish that a product update succeeded.

Keep those failures explicit in Ruby. Turning every missing response value into an empty collection can make a failed import look successful. The same debugging principle applies when tracing a Ruby undefined method error involving nil: find the missing value before hiding its consequences.

GraphQL throttling depends on query cost. Read the returned throttle information, schedule retries and avoid fetching unnecessary nested data. A tiny development catalogue will not expose the same pressure as a busy merchant’s store.

Make the report resumable. Record the last processed page and distinguish an empty result from an incomplete run. If a worker stops halfway through, the next attempt should continue safely or rebuild the report without emailing the merchant twice.

Make the first app survive a retry

For HTTPS webhooks, verify the HMAC against the raw request body before trusting the payload. Persist accepted work durably and respond promptly, then let a worker perform the expensive processing. Repeated deliveries must not create repeated business actions.

Store delivery identifiers and enforce uniqueness in the database. Make the job itself safe to retry as well: recording a webhook once does not prevent a worker from running twice after a crash. Decide how to reconcile an interrupted update before adding a retry button.

Before handing the app over, test installation, missing permissions, expired credentials, duplicate delivery and uninstall. Let the merchant see when a report last completed and what needs attention. Your first release earns trust when an ordinary failure leaves an understandable result and a practical recovery route.

Give the client a short operating guide covering hosting, secret rotation and who manages failed jobs. Agree when dependencies and Shopify API versions will be reviewed. Those responsibilities belong in the delivery plan, even when the first release only produces one email. Include a named support contact.