mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 22:15:14 +00:00
11 lines
375 B
Ruby
11 lines
375 B
Ruby
require "posthog"
|
|
|
|
if ENV["POSTHOG_API_KEY"].present?
|
|
$posthog = PostHog::Client.new({
|
|
api_key: ENV["POSTHOG_API_KEY"],
|
|
host: ENV.fetch("POSTHOG_HOST", "https://us.i.posthog.com"),
|
|
on_error: proc { |status, msg| Sentry.capture_message("PostHog error: #{status} - #{msg}"); Rails.logger.error "PostHog error: #{status} - #{msg}" }
|
|
})
|
|
else
|
|
$posthog = nil
|
|
end
|