Package Exports
- @homebaseai/vue3-intercom
- @homebaseai/vue3-intercom/build/plugin.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@homebaseai/vue3-intercom) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
vue3-intercom
npm i @homebaseai/vue3-intercom
Usage
Apply the plugin via app.use
.
import { createApp } from 'vue'
import VueIntercom from '@homebaseai/vue3-intercom';
import App from '@/App.vue';
const app = createApp(App);
app.use(VueIntercom);
app.mount('#app');
Composition API
<script setup lang="ts">
import { useIntercom } from '@homebaseai/vue3-intercom';
const intercom = useIntercom();
// init intercom
intercom.boot({
app_id: import.meta.env.VITE_APP_INTERCOM_TOKEN,
user_id: 1,
name: 'John Doe',
email: 'john@exampl.com',
});
// display it
intercom.show();
</script>
Options API
<script lang="ts">
import { useIntercom } from '@homebaseai/vue3-intercom';
export default {
setup() {
return {
intercom: useIntercom(),
}
},
data() {
return {
userId: 1,
name: 'John Doe',
email: 'john@example.com',
}
},
mounted() {
// init intercom
intercom.boot({
app_id: import.meta.env.VITE_APP_INTERCOM_TOKEN,
user_id: this.userId,
name: this.name,
email: this.email,
});
// display it
intercom.show();
}
}