zSoulweaver / kient

TypeScript-First Client Library for Kick.com
https://kient.pages.dev/
MIT License
29 stars 11 forks source link

feat: Add support for new 'x-kick-auth' header. #6

Closed hparcells closed 9 months ago

hparcells commented 9 months ago

This PR aims to add an optional x-kick-auth header to each callKickApi() call.

In my case, this resolves the issue of being unable to use the kick-token-provider endpoint when using client.api.authentication.login(). This was due to a CloudFlare challenge before the response of the endpoint.

SOMETHING_WENT_WRONG: Failed to retrieve pre-login tokens

This header was verified using curl with and without the header on the machine receiving the CloudFlare challenge.


I wasn't sure if I should have added the auth token as an optional field inside of the LoginCredentials interface or as an extra kickAuth parameter when calling login(), so I chose the latter.

hparcells commented 9 months ago

Resolved!

zSoulweaver commented 9 months ago

LGTM.

Sorry for delay, I'll go ahead and publish a new version shortly.

Edit: v1.0.1-12 published to npm