devrnt / react-use-intercom

☎️ React Intercom integration without the hassle, powered by hooks.
https://devrnt.github.io/react-use-intercom/#/useIntercom
MIT License
333 stars 43 forks source link

feat: add showNews method #648

Closed stefanoCrmg closed 9 months ago

stefanoCrmg commented 1 year ago

Intercom has recently(?) added the showNews feature and I figured it might be worth it to map it 😄 https://developers.intercom.com/installing-intercom/docs/intercom-javascript#intercomshownews-newsitemid

I would have also added an e2e test for the feature but without having an actual news on the intercom instance it just didn't make much sense.

If you could please create a news on Intercom and provide the newsId I'll gladly write an E2E for it!

changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: 4cbd43a9a663d8c9ed88724ac74f54e25e2a30e6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------------ | ----- | | react-use-intercom | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

devrnt commented 1 year ago

This is great, big thanks! I've created a news item (33910172) and tested it but at the moment it doesn't work. I think this has to do with the fact that this feature is still in beta

bel0v commented 1 year ago

Hi! really looking forward to this feature. I wired it up it with

      window.Intercom.apply(null, ['showNews', id])

for now and it worked. Hoping to see it in react-use-intercom's API!

P.S I had to figure out what the news item id is.

This is not the right one:

Screenshot 2023-06-22 at 14 42 36

The one you're looking for can be found if you click into a news item, and in its url you'll find

https://news.intercom.com/my-awesome-company/news/12345-my-news

where 12345 is the one you want

stefanoCrmg commented 1 year ago

Yep, unfortunately it looks like I'll need a different ID to make the example work and not just show a white screen 🤔 I reviewed my PR a bit as I had introduced an upgrade to pnpm.lock by error, the CI checks should work fine now.

devrnt commented 1 year ago

Hi! really looking forward to this feature. I wired it up it with

      window.Intercom.apply(null, ['showNews', id])

for now and it worked. Hoping to see it in react-use-intercom's API!

P.S I had to figure out what the news item id is.

This is not the right one: Screenshot 2023-06-22 at 14 42 36

The one you're looking for can be found if you click into a news item, and in its url you'll find

https://news.intercom.com/my-awesome-company/news/12345-my-news

where 12345 is the one you want

This is interesting, thanks. Unfortunately, I can't create a news item for the playground namespace. News is at the moment not part of the Intercom development namespace

devrnt commented 1 year ago

Unfortunately, I can't create a news item for the playground namespace. News is at the moment not part of the Intercom development namespace

Big thanks. Unfortunately, I can't create a news item for the playground namespace. News is at the moment not part of the Intercom development namespace

stefanoCrmg commented 1 year ago

@devrnt I've tried countless of time building this project in a docker container running node@18.16.0 just like the github action but I can never get the build to fail.

Do you have any idea on what I should take a look at to get everything to work? I'm a bit lost 🤔

devrnt commented 1 year ago

The pipeline is working again. Still thinking about what to do with the news id in the examples

devrnt commented 9 months ago

Later than expected but I decided to merge this PR even without a working example. I still can't create a news item for the playground/demo namespace

devrnt commented 9 months ago

Big thanks!

devrnt commented 9 months ago

5.2.0