Closed rorhug closed 1 year ago
Hi, thanks for your PR. Can you take a look at the failed build? I definitely want to merge it
Added number to the time types. Docs: https://www.intercom.com/help/en/articles/3605703-how-dates-work-in-intercom
Intercom accepts any of the following for a datetime:
"2023-01-30T11:28:45.181Z" "1675078024647" 1675078024647
Hence why I'm suggesting created_at and last_request_at take a string | number
Thanks for trying to fix it - I wasn't able to run the checks.
I think we need parseInt to floor the number as recommended in the intercom docs. The errors from the a98be4b commit were for assigning a number to a string.
parseInt takes a number and returns a number so should probably be included and instead the number type should be added in another type def.
My bad! parseInt only takes a string according to typescript so switched it to math.floor.
This version typescript compiles I think now.
Thanks, can you sync with the upstream please?
FYI: the upstream main branch was renamed from master
to main
The attribute to do a "page view" update (without user attribute changes) is
last_request_at
, rather thanlast_requested_at
. This translates to the default attribute in the Intercom UI "Last Seen" (source)Also, the attribute takes seconds rather than milliseconds.
Here's the documentation which talks about doing page view updates: https://www.intercom.com/help/en/articles/170-integrate-intercom-in-a-single-page-app
With the current version of this package, user objects in Intercom have the following invalid attribute:![Screenshot 2023-01-28 at 18 43 33](https://user-images.githubusercontent.com/544628/215285262-6d93a464-fa39-41d9-8f68-5c3b93f0b91e.png)