Skip to content

Conversation

@agerlic
Copy link
Contributor

@agerlic agerlic commented Mar 9, 2025

Fix LinearClient initialization to match Linear SDK documentation

This PR fixes an issue with the LinearClient initialization in the Personal Access Token (PAT) flow. According to the Linear SDK documentation, when using API key authentication, the client should be initialized with the apiKey parameter rather than the accessToken parameter.

@agerlic
Copy link
Contributor Author

agerlic commented Mar 10, 2025

FYI @ocasta181

@ngub
Copy link

ngub commented Apr 17, 2025

Spent some time debugging the following error:

GraphQL operation failed: It looks like you're trying to use an API key as a Bearer token. Remove the Bearer prefix from the Authorization header.

Here's the exact place in the Linear SDK that produces it: https://github.com/linear/linear/blob/master/packages/sdk/src/client.ts#L34

I came up with the same solution as in the PR, would love to see it merged 🙏

@SvenMeyer
Copy link

@agerlic @ngub
I actually implemented the same fix, even made a pull request (#10) which I deleted when I checked thereafter the outstanding pull requests.
After some review it looks like that #3 fixed the authentication issue and some other issues.
There was just one error which I fixed and bundled into a new pull request #11
Authentication with an API key should work now.

You may want to test that and provide feedback.

Maybe it even allows now OAuth, I saw some code in #3 , but I haven't tested it myself.

@ocasta181
Copy link
Contributor

Hey, thanks for the contribution @agerlic!

@ocasta181 ocasta181 merged commit b4823a3 into cline:main Apr 27, 2025
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.

4 participants