No commit activity in last 3 years
No release in over 3 years
CherryPie Rails SDK
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

CherryPie Rails SDK

Cherrypie Rails SDK.

Installation

Add this line to your application's Gemfile:

gem 'cherrypie-rails-sdk', '~> 0.2.7'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install cherrypie-rails-sdk

Usage

# config/application.rb

require_relative "boot"

require "rails/all"
require 'cherrypie_rails_sdk'

Bundler.require(*Rails.groups)

module ExampleApp
  class Application < Rails::Application
    ...
  config.middleware.use(CherrypieRailsSdk::Middleware, "<TOKEN>",
  lambda{ |request| {
    # request: ActionDispatch::Request
    "entityKey"=> "1", "name"=> "RAILS"
    } },
  )
  end
end

API Key

Your API key can be found here: https://app.cherrypie.app/settings.

Identity function

Every request that is logged in CherryPie needs to be associated with a specific entity. If your API's consumers are individuals, you might choose a user's UserId as their EntityKey. If your consumers are workspaces or organizations, you might choose to identify the entityKey with an OrganizationId.

The identity function will be called everytime a log comes in to populate the body of the request that is sent to CherryPie.