Skip to content

Cannot initilizate intercom manually #28

Open
@cstriuli

Description

@cstriuli

Hi there 🙌,

First of all, thanks for the module! Awesome work.

About the issue

I've got a special case where I need to initialize the Intercom through an API using differents App ID's, so for example:

  • domain.com/us should load the app id XXX-1
  • domain.com/jp should load the app id XXX-2
  • domain.com/uk should load the app id XXX-3

So I've tried to boot manually from a custom plugin in nuxt like this:

export default({$intercom, store}) => {
   const appId = store.state.country.intercomAppId
   $intercom.boot({app_id: appId})
}

But it doesn't work because the module isn't being loaded if the nuxt.config.js doesn't contain a valid app_id, so there's no way to initialize the plugin manually.

Would you mind checking the following code?

if (!options.appId) {

Could I help to send a PR or let me know if I'm doing something wrong?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions