Skip to content

Commit

Permalink
Merge pull request #69 from Eazybright/feat/user-agent-header
Browse files Browse the repository at this point in the history
Add the user-agent request header to every call in this sdk.
  • Loading branch information
unicodeveloper authored Jan 19, 2024
2 parents 16b0c0a + c779ecc commit 122010e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/novu/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
require "novu/api/subscribers"
require "novu/api/tenants"
require "novu/api/topics"
require_relative "version"

module Novu
class Client
Expand Down Expand Up @@ -67,7 +68,11 @@ def initialize(access_token: nil, idempotency_key: nil, enable_retry: false, ret
@initial_delay = retry_config[:initial_delay]
@max_delay = retry_config[:max_delay]

self.class.default_options.merge!(headers: { "Authorization" => "ApiKey #{@access_token}" })
self.class.default_options.merge!(headers: {
"Authorization" => "ApiKey #{@access_token}",
"User-Agent" => "novu/ruby/#{Novu::VERSION}"
}
)

# Configure the exponential backoff - specifying initial and maximal delays, default is 4s and 60s respectively
if @enable_retry
Expand Down

0 comments on commit 122010e

Please sign in to comment.