Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ability to provide custom http client #75

Merged
merged 1 commit into from
Feb 1, 2022
Merged

Conversation

peterdeme
Copy link
Contributor

Ability to provide custom http client

spec/client_spec.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@ffenix113 ffenix113 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superb work.

@peterdeme peterdeme merged commit bfff20d into master Feb 1, 2022
@peterdeme peterdeme deleted the custom-client branch February 1, 2022 19:46
# initializes a Stream Chat API Client from STREAM_KEY and STREAM_SECRET
# environmental variables.
def self.from_env
Client.new(ENV['STREAM_KEY'], ENV['STREAM_SECRET'])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we have @api_key = api_key || ENV['STREAM_KEY'] do you think we need to provide values here instead of just Client.new?

I also see that we need to change def initialize(api_key = '', api_secret = '', timeout = 6.0, **options) to def initialize(api_key = nil, api_secret = nil, timeout = 6.0, **options) so in function it will pick up environment variables. Seems like a bug.

@github-actions github-actions bot mentioned this pull request Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants