npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@evaro/connect-vue

v0.1.0

Published

Native Vue 3 integration for Evaro Connect. Drop-in components and composables for Vue and Nuxt apps.

Readme

@evaro/connect-vue

Native Vue 3 integration for Evaro Connect. Drop this into any Vue 3 or Nuxt app and skip the manual isCustomElement config and the SSR gymnastics that come with using the bare web component directly.

Install

pnpm add @evaro/connect-vue
# or
npm install @evaro/connect-vue

Peer dependencies: vue >= 3.4. Works under Nuxt 3 with no extra setup.

Quick start

Embed an Evaro block

Render a full landing page, a small callout, or any other Evaro-hosted block with one component:

<script setup lang="ts">
import { EvaroLanding } from '@evaro/connect-vue'
</script>

<template>
  <EvaroLanding
    vendor="03f0db937fd156141d272250a2b59f"
    template="erectile-dysfunction"
  />
</template>

The component fetches the prerendered block and renders it inside a Shadow DOM. Your Vue tree and CSS stay untouched. The CDN and analytics URLs resolve automatically — see Environments.

Add launcher buttons

For call-to-action buttons that open Connect, wrap your app with <EvaroProvider> and map your conditions:

<script setup lang="ts">
import { EvaroProvider } from '@evaro/connect-vue'

const conditions = {
  'erectile-dysfunction': '93e6e49e13c458706634eecd58423a',
  'migraine-relief':      '4f4ce914783df03cc18e793cb8bff0',
  'weight-loss':          '70198fea75871263274d8a554ed584',
}
</script>

<template>
  <EvaroProvider
    vendorHash="03f0db937fd156141d272250a2b59f"
    :conditions="conditions"
  >
    <slot />
  </EvaroProvider>
</template>

Then drop the launcher anywhere:

<script setup lang="ts">
import { EvaroConnect } from '@evaro/connect-vue'
</script>

<template>
  <EvaroConnect condition="migraine-relief" class="cta-button">
    Start free consultation
  </EvaroConnect>
</template>

Connect's iframe.js loads lazily on first click — your page bundle stays small.

Environments

You never paste a URL. The package resolves Evaro's CDN and API automatically — production by default. From your staging site, pass env="staging" on the provider or directly on a component:

<EvaroLanding vendor="…" template="…" env="staging" />
<EvaroProvider vendorHash="…" env="staging">…</EvaroProvider>

env accepts staging, prod, and the alias preview (resolves to staging) — pass VERCEL_ENV straight through. One value resolves the landings CDN, the analytics API, and the Connect launcher together.

Nuxt and SSR

The components are SSR-safe. They render an empty placeholder on the server and create the underlying web element on client mount. There is nothing to gate behind <ClientOnly> and no isCustomElement config to add.

The web element is created via document.createElement inside a Vue-managed wrapper, so no evaro-* tag ever appears in your template — Vue's compiler never warns about an unknown element.

<EvaroProvider> props

| Prop | Type | Notes | |---|---|---| | vendorHash | string (required) | Your Evaro vendor hash (32 hex). One value per app. | | conditions | Record<string, string \| ConditionMapping> | Optional. Lookup table for <EvaroConnect condition="...">. Values can be a bare questionnaire hash, a full link, or an object with questionnaireId, productId, or link. | | env | 'staging' \| 'preview' \| 'prod' | Optional. Evaro environment; resolves the CDN + API URLs. Default prod. Inherited by nested components. | | apiBase | string | Optional. Explicit API base URL — advanced override, prefer env. |

<EvaroLanding> props

| Prop | Type | Notes | |---|---|---| | template | string (required) | Landing template slug. | | vendor | string | Vendor hash. Required unless inherited from <EvaroProvider>. | | category | string | Optional. Category slug for a shared, category-driven template. A category Evaro has not published renders nothing. | | env | 'staging' \| 'preview' \| 'prod' | Optional. See Environments. Inherited from the provider; default prod. | | cdn / apiBase | string | Optional explicit URL overrides — advanced, prefer env. |

Events: ready when the manifest renders, load-error if the fetch fails.

<EvaroConnect> props

| Prop | Type | Notes | |---|---|---| | link | string | Direct link, e.g. abc/product/p1. Takes precedence over category and condition. | | condition | string | Looks up the link from <EvaroProvider :conditions="{...}">. | | vendor | string | Vendor hash. Required for category; otherwise inherited from <EvaroProvider>. | | category | string | Category slug, resolved against the vendor's Evaro-hosted category map. A category Evaro has not published renders nothing. | | cdn | string | Explicit CDN origin for the category map. Advanced override — prefer env. | | patient | { state?: object } | Prefill data merged into Connect's localStorage before opening. | | env | 'staging' \| 'preview' \| 'prod' | Optional. Inherited from <EvaroProvider>; default prod. | | disabled | boolean | Standard disabled behavior. |

Events: open(link, event) fires before the open call, error(err) fires when the lazy-load or open fails.

Composables

useEvaroAnalytics(handler)

Subscribe to Connect's analytics events. The handler fires for every EVARO_ANALYTIC_EVENT dispatched by the iframe.

<script setup lang="ts">
import { useEvaroAnalytics } from '@evaro/connect-vue'

useEvaroAnalytics(({ event, data }) => {
  if (event === 'evaro_purchase') {
    yourAnalytics.track('partner.conversion', data)
  }
})
</script>

The handler is captured at setup time; pass a stable reference (a method, not an inline function recreated on every render).

useEvaroState()

Returns a reactive ref of { cart, user } derived from Connect's localStorage. Reads window.evaro_state on mount and updates from EVARO_STATE_UPDATE events.

<script setup lang="ts">
import { useEvaroState } from '@evaro/connect-vue'

const state = useEvaroState()
</script>

<template>
  <span v-if="state.user">Welcome back</span>
  <SignIn v-else />
</template>

Analytics

The Evaro API is the source of truth for analytics config. The provider loads /json/api/v1/vendor/{vendor}/gtm-snippet and /json/api/v1/vendor/{vendor}/event-handler on mount; both endpoints return empty strings when the vendor has no google_tag_manager_id configured. No GTM ID on the Vue side.

If your site has its own GTM container, it sits alongside Evaro's on the same window.dataLayer. Evaro event names are namespaced (page_view_dlv, the Evaro ecommerce names) so your container can filter them with exclusion rules if needed. To forward Evaro events to a different analytics system, use useEvaroAnalytics().

TypeScript

Full types are exported. See dist/index.d.ts after install.