-
Notifications
You must be signed in to change notification settings - Fork 118
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
Not able to set intercom-version in headers for useRequestOpts #326
Comments
I'm also getting the same error: |
+1 client version 3.1.5, typescript version 4.2.2 |
The typings for this library in general are embarrassingly bad :| |
@ mullwaden submit a feature request to intercom support for better typings in this lib. I submitted one a couple weeks back. |
How is this still open? I'm having same issue |
I believe for now you have to set it like this: intercom.useRequestOpts({
headers: {
common: {
'Intercom-Version': 2.6,
},
get: {},
head: {},
post: {},
delete: {},
put: {},
patch: {},
}
})
} |
Version info
Expected behavior
Setting the intercom-version with:
Actual behavior
When using TS I get this error:
Type '{ 'Intercom-Version': number; }' is not assignable to type 'HeadersDefaults'. Object literal may only specify known properties, and ''Intercom-Version'' does not exist in type 'HeadersDefaults'.ts(2322) index.d.ts(112, 3): The expected type comes from property 'headers' which is declared here on type 'Partial<AxiosDefaults<any>>'
Seems like it is linked to the sub dependency axios's type HeaderDefaults.
Steps to reproduce
Logs
No logs, just a lint error.
The text was updated successfully, but these errors were encountered: