{"id":27641389,"url":"https://github.com/beyonk-group/svelte-intercom","last_synced_at":"2025-07-12T02:10:36.638Z","repository":{"id":44026534,"uuid":"227915380","full_name":"beyonk-group/svelte-intercom","owner":"beyonk-group","description":"Intercom for Svelte or Vanilla JS Apps","archived":false,"fork":false,"pushed_at":"2022-07-15T16:41:44.000Z","size":580,"stargazers_count":2,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-25T17:16:54.230Z","etag":null,"topics":["crm","customer-chat","help","intercom","messenger","support","svelte","sveltejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beyonk-group.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["antony"]}},"created_at":"2019-12-13T20:18:02.000Z","updated_at":"2024-05-31T08:56:56.000Z","dependencies_parsed_at":"2022-09-15T03:00:39.279Z","dependency_job_id":null,"html_url":"https://github.com/beyonk-group/svelte-intercom","commit_stats":null,"previous_names":["beyonk-group/svelte-intercom","beyonk-adventures/svelte-intercom"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/beyonk-group/svelte-intercom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyonk-group%2Fsvelte-intercom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyonk-group%2Fsvelte-intercom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyonk-group%2Fsvelte-intercom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyonk-group%2Fsvelte-intercom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beyonk-group","download_url":"https://codeload.github.com/beyonk-group/svelte-intercom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyonk-group%2Fsvelte-intercom/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264923683,"owners_count":23683785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crm","customer-chat","help","intercom","messenger","support","svelte","sveltejs"],"created_at":"2025-04-23T23:46:50.604Z","updated_at":"2025-07-12T02:10:36.618Z","avatar_url":"https://github.com/beyonk-group.png","language":"JavaScript","funding_links":["https://github.com/sponsors/antony"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://beyonk.com\"\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/218949/144224348-1b3a20d5-d68e-4a7a-b6ac-6946f19f4a86.png\" width=\"198\" /\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n\u003c/a\u003e\n\n## Svelte Intercom\n\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com) [![svelte-v3](https://img.shields.io/badge/svelte-v3-blueviolet.svg)](https://svelte.dev) ![](https://github.com/actions/beyonk-adventures/workflows/publish/badge.svg)\n\nPure vanilla JS Intercom integration\n\n## Install\n\n```bash\n$ npm install --save-dev @beyonk/svelte-intercom\n```\n\n## Usage (With Svelte)\n\nPlace the IntercomLauncher at the top level of your application (_layout.svelte for Sapper)\n\n```html\n\u003cIntercomLauncher appId='abcde12345' /\u003e\n\n\u003cscript\u003e\n  import { IntercomLauncher, intercom } from '@beyonk/svelte-intercom'\n\u003c/script\u003e\n```\n\n## Other configuration attributes\n\nThere are a number of configuration attributes you can pass, all but appId are optional.\n\nList of possible options in the module:\n\n| Option            | Default      | Required | Description                                                                                                                           |\n|-------------------|--------------|----------|---------------------------------------------------------------------------------------------------------------------------------------|\n| appId             | -            | true     | Your Intercom app id                                                                                                                  |\n\n## Events\n\nThe Component emits all events emitted by the intercom module:\n\n```html\n\u003cIntercomLauncher appId='abcde12345' on:unread-count-change={logUnreadCount} /\u003e\n\n\u003cscript\u003e\n  import { IntercomLauncher } from '@beyonk/svelte-intercom'\n\n  function logUnreadCount (unreadCount) {\n    console.log('Unread count', unreadCount)\n  }\n\u003c/script\u003e\n```\n\nList of possible events in the module:\n\n| Event                | Description                                                                                                                             |\n|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| unread-count-change  | [onUnreadCountChange](https://developers.intercom.com/installing-intercom/docs/intercom-javascript#section-intercomonunreadcountchange) |\n| show                 | [onShow](https://developers.intercom.com/installing-intercom/docs/intercom-javascript#section-intercomonshow) |\n| hide                 | [onHide](https://developers.intercom.com/installing-intercom/docs/intercom-javascript#section-intercomonhide) |\n| ready                | Dispatched when the intercom component has finished initialising |\n\n## Methods\n\nThe Component has all methods listed in [the intercom documentation](https://developers.intercom.com/installing-intercom/docs/intercom-javascript).\n\nThese methods are exposed by the `intercom` module. This module can be imported anywhere in your project to call methods on the Messenger.\n\n```html\n\u003cIntercomLauncher appId='abcde12345' /\u003e\n\n\u003cscript\u003e\n  import { IntercomLauncher, intercom } from '@beyonk/svelte-intercom'\n\n  intercom.startTour()\n\u003c/script\u003e\n```\n\nThe component implements a couple of extra convenience methods:\n\n\nList of possible events in the module:\n\n| Event                | Description       |                                                                                                                      |\n|----------------------|-------------------|\n| showLauncher()       | show the launcher |\n| hideLauncher()       | hide the launcher |\n\n## The underlying instance\n\nYou can access the underlying intercom instance for anything else you require:\n\n```html\n\u003cIntercomLauncher appId='abcde12345' bind:this={intercom} /\u003e\n\n\u003cscript\u003e\n  import { IntercomLauncher } from '@beyonk/svelte-intercom'\n\n  const rawIntercom = intercom.getIntercom()\n\u003c/script\u003e\n```\n\n## Troubleshooting\n\n### Q. How do I hide the launcher for specific pages?\n\nBecause of the strange way intercom's launcher hiding works, you need to add the following to your route to hide it for that specific page.\n\n```\nimport { onMount, onDestroy } from 'svelte'\n\nonMount(async () =\u003e {\n  intercom.overrideBootSettings({ hide_default_launcher: true })\n  intercom.hideLauncher()\n})\n\nonDestroy(intercom.showLauncher)\n```\n\nThis will:\n* add a boot setting for intercom to hide the launcher by default, if the page is the first page the user visits in your application.\n* hide the launcher immediately for the page\n* set a hook so that if the user navigates away from the page, the launcher shows again.\n\n## Developing\n\nIn order to run the local demo you *must* pass a valid intercom app id otherwise it won't work:\n\n```\nAPP_ID=\u003cyour-app-id\u003e npm run dev\n```\n\n## License\n\n[MIT License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyonk-group%2Fsvelte-intercom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeyonk-group%2Fsvelte-intercom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyonk-group%2Fsvelte-intercom/lists"}