| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This Ruby On Rails project demonstrates how to use the https://github.com/XeroAPI/xero-ruby SDK.
Its purpose is to speed up new ruby devs looking to build amazing applications with the data of users of the Xero Accounting platform: https://xero.com/. Secure authentication is setup using industry standard OAuth2.0. Access/Refresh tokens fuel authorized api calls.
Note: this project was built using:
git clone git@github.com:XeroAPI/xero-ruby-oauth2-app.git cd xero-ruby-oauth2-app bundle install yarn
Create a .env in the root of your project directory or replace the env.sample
CLIENT_ID=... CLIENT_SECRET=... REDIRECT_URI=...
bundle exec rake db:create db:migrate yarn rails s
By default rails runs on port 3000. Make sure you have in your /myapps dashboard 'http://localhost:3000/callback' or specify the port with rails s -p 8080 etc.
The project shows a strategy to effectively leverage the xero-ruby SDK. It is best documented by cloning/running the app but here are a few tips to quickly understanding the structure if you are not familair with Rails.
Bulk of the auth flow logic. This uses a few helpers but shows how to handle the full authentication flow, refresh a token, disconnect an org, and even change which org you want to make api calls to.
This includes some helpers that showcase how to decode the individual pieces of the token_set and show the multiple ways you can setup the xero_client, etc..
You are very welcome to add/improve functionality - we will continue to make improvements that show more complex API usage like filter/sorting, paginating, and will add more CRUD workflows as new API sets are added to the ruby-sdk. Please open an issue if something is not working correctly.
| Back | FazBrowse Home | New Git URL |