Skip to content

Instantly share code, notes, and snippets.

@cdrani
Created November 19, 2021 18:45
Show Gist options
  • Save cdrani/fb24dab2454c1ee32da628491566cc65 to your computer and use it in GitHub Desktop.
Save cdrani/fb24dab2454c1ee32da628491566cc65 to your computer and use it in GitHub Desktop.
Braze Configuration Setup
module Braze
class << self
attr_accessor :configuration
end
def self.configure
self.configuration ||= Configuration.new
yield(configuration)
end
class Configuration
attr_accessor :rest_api_url, :api_key
def initialize
@rest_api_key = ENV['BRAZE_REST_API_URL']
@api_key = ENV['BRAZE_API_KEY']
end
end
end
# config/initializers/braze.rb
Braze.configure do |config|
config.url = EN
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment