Ask A Question

Notifications

You’re not receiving notifications from this thread.

Pattern for Managing Third Party Integrations

Matt Walston asked in Rails

I'm building a small internal app that is essentially glue between several open APIs. Namely, QuickBooks, G Suite, Stripe, and Twilio. Authorizing these third party integrations, maintaining tokens, refreshing tokens and providing an oauth2 client for these services has been a little disorganized. I've been able to find very little in terms of patterns or architectual guidance for organizing these integrations. Can anyone suggest an OSS project that's done this well or an article?

Reply

Bump! Interested in seeing if someone has an answer to this?

Reply

Hey Matt,

A pattern I've used is to create a folder called api_clients/ with subfolders for each api_wrapper.

For example, on one project, I did the following

api_clients/
--/xero
--/fitbit
--/stripe

Each of these folders contain the code I need to integrate with the apis. I generally organize each folder with like this https://github.com/williamkennedy/tryterra_api/tree/main/lib/try_terra

The aim is that I would be able to call something like

client = Xero::Client.new
client.invoices => Xero::Invoices class

Hope that helps.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.