Project

actor_sync

0.0
Low commit activity in last 3 years
No release in over a year
Automatically synchronise actor information to your third party systems e.g. Mixpanel, Sendgrid, etc.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.0
~> 5.14
>= 0

Runtime

 Project Readme

Actor Sync

Automatically synchronise actor information to your third party systems e.g. Mixpanel, Sendgrid, Segment etc. I currently use this in production on Frain.

Getting Started

config/initializers/actor_sync.rb

ActorSync.configure do |config|
   config.sync = true
   config.mixpanel = { project_token: '' }
   config.mailchimp = { api_key: '' }
end

app/models/user.rb

class User < ApplicationRecord
   include ActorSync

   actor_sync :mixpanel
   actor_sync :mailchimp, audience: monthly_mailing_lists

   def data_to_export_to_mixpanel
      {
         '$first_name': profile.first_name,
         '$last_name': profile.last_name,
         '$email': email
      }
   end
end

app/models/company.rb

class Company < ApplicationRecord
   include ActorSync

   actor_sync :mixpanel, group: true

   def data_to_export_to_mixpanel
      {
         '$name': name,
         'products': products_count
      }
   end
end

TODO

  • Write more tests.
  • Add Instrumentation
  • Add support for other activejob backends - Resque etc.
  • Add support for NoSQL Databases
  • Add support for Sinatra (Non-Rails environment)
  • More documentation
  • Add rake tasks to manually sync data
  • Add support for mixpanel lookup tables