Open poppet-uk opened 1 year ago
Hi @poppet-uk
I'm a little unsure of the issue here. The documented way of adding an api key is const client = new Client({ tokenAuth: { token: 'my_token' } });
as documented in the readme.
Could you let me know a little bit more about your use case
Certainly,
So in the client.d.ts file, the types indicate that I can authenticate using an apiKey and appId.
However trying to do so returns the aforementioned error.
Our usecase is that we have an intercom for production and an intercom app for testing. In order to work with exclusively our testing app, we can't simply authenticate with the authToken as I believe that's linked to our production env.
So I did some digging on this.
appAPIKey
in this context refers to a legacy token system we used before the Developer Hub was created (circa 2018).
If you created your app in the dev hub and have a auth key from there then it uses TokenAuth exclusively. The api is returning
unauthorized
since your key does not exist on that workspace in the legacy auth system we have.
I'll keep this issue open though since we clearly need to document the different schemes of auth that the SDK supports and how they work.
Please use the following template to submit your issue. Following this template will allow us to quickly investigate and help you with your issue. Please be aware that issues which do not conform to this template may be closed.
For feature requests please contact us at team@intercom.io
Version info
Expected behavior
Actual behavior
Any request I make using the "apiKeyAuth" returns "unauthorized".
Steps to reproduce
Logs