OmniAuth strategy for Etsy
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

OmniAuth Etsy

An unofficial OmniAuth strategy for Etsy. To use it, you'll need OmniAuth and a registered application on Etsy.


OmniAuth::Etsy is Rack middleware. Below are examples written specifically for Rails 3.1+, however it can be used in other frameworks based off of Rack (Sinatra, etc). See the OmniAuth docs for detailed usage examples.

Create an initializer file, and tell OmniAuth you'd like to register Etsy as a provider:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :etsy, ENV['ETSY_TOKEN'], ENV['ETSY_SECRET']

Etsy allows for sandbox API requests; to utilize it add sandbox to your config:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :etsy, ENV['ETSY_TOKEN'], ENV['ETSY_SECRET'], :sandbox => true

Note: Etsy's sandbox API may return rather unusual results. I advise when making read-only requests to simply forgo the sandbox.

Optionally, you may also pass in comma-separated Permission Scopes:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :etsy, ENV['ETSY_TOKEN'], ENV['ETSY_SECRET'], :scope => 'email_r,profile_r,listings_r'

Note: If for some reason you receive a 400 error, it's probably your scopes.

Auth hash

On callback this is what you can expect in your request.env['omniauth.auth'] info hash:

provider: etsy
uid: 12341241
  nickname: 'nickname'
  email: ''
  user_id: 12341241
  first_name: 'Bill'
  last_name: 'Clinton'
  name: 'Bill Clinton'
  image: ''
    user_profile_id: 12341241
    user_id: 12341241
    login_name: 'nickname'
    bio: ''
    gender: private
    birth_month: '0'
    birth_day: '0'
    birth_year: '0'
    join_tsz: 1337366290
    materials: ''
    country_id: ''
    region: ''
    city: ''
    location: ''
    avatar_id: ''
    lat: ''
    lon: ''
    transaction_buy_count: 0
    transaction_sold_count: 0
    is_seller: false
    image_url_75x75: ''
    first_name: 'Bill'
    last_name: 'Clinton'


Add OmniAuth and OmniAuth::Etsy to your application's Gemfile:

gem 'omniauth', '~>1.0'
gem 'omniauth-etsy', '~>0.1.0'

And then execute:

$ bundle

Or install it yourself as:

$ gem install omniauth
$ gem install omniauth-etsy

OmniAuth::Etsy has been used on both Ruby 1.9.2 and REE 1.8.7.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request