@signap/signals-nuxtjs

SSR-safe Nuxt 3 wrapper for @signap/signals-web
1,002
Install
npm install @signap/signals-nuxtjs
Latest Version:2.2.0
Vue:3
License:Apache-2.0
Last Updated:Oct 9, 2026
Links: npm
Maintainer: nox.xou

@signap/signals-nuxtjs

SSR-safe wrapper for @signap/signals-web targeting Nuxt 3.

Install

pnpm add @signap/signals-nuxtjs
# nuxt + vue are peerDependencies

Usage

Wrap your app once in app.vue with <SignalsClient>, then call useVisitorData() in any <script setup> below it.

<!-- app.vue -->
<script setup lang="ts">
import { SignalsClient } from "@signap/signals-nuxtjs";
const agent = { apiKey: useRuntimeConfig().public.signalsApiKey };
</script>

<template>
  <SignalsClient :agent="agent">
    <NuxtPage />
  </SignalsClient>
</template>
<!-- components/VisitorBadge.vue -->
<script setup lang="ts">
import { useVisitorData } from "@signap/signals-nuxtjs";
const { data, isLoading } = useVisitorData({ tag: "homepage" });
</script>

<template>
  <span v-if="!isLoading">visitor: {{ data?.visitorId }}</span>
</template>

v2 (ADR §A2) returns the resolved visitor in a single round-trip — no separate ack/lookup transition. The composable returns reactive refs; see the @signap/signals-vue README for the full shape.

Holding collection

<SignalsClient :agent="…" :enabled="false"> keeps the agent from loading. It is the Vue provider's enabled (see @signap/signals-vue): while it is false the SDK registers no event listener, runs no collector and sends no request, and useVisitorData() returns isHeld: true. Setting it to true loads the agent and runs the first identify, exactly as if enabled had never been set. Setting it back to false stops the SDK's interaction listeners for the whole page and discards any identify result still in flight; a request that has already been sent is not recalled.

Holding or releasing does not delete anything Signap has already received.

The hold applies to the agent this component loads. A copy of the SDK loaded another way, for example the CDN script, is not held.

SSR-safe contract

  • The barrel imports cleanly on the Nitro/Node server — module evaluation touches no browser APIs.
  • SignalsClient just wraps <SignalsProvider>, which loads the agent inside onMounted — never during SSR render or hydration.
  • Public env vars carry only the public apiKey (pk_live_*); never put server-only secrets in runtimeConfig.public.

Endpoint (required)

SignalsClient takes the underlying AgentLoadOptions as its agent prop. endpoint is required — the published SDK ships no baked default host (the region→host map is empty in this alpha), so pass an explicit endpoint (a string or a callback). See the @signap/signals-web README (Endpoint section).

Related Packages

@signap/signals-vue

Vue 3 composable wrapper for @signap/signals-web

1,235

Version History

Version Released Vue License
2.2.0 >=3 <4 Apache-2.0
2.1.0 >=3 <4 Apache-2.0
2.0.0 >=3 <4 Apache-2.0
Pre-releases (3)
Version Released Vue License
2.2.0-dev.20260930004737.ga1de46e >=3 <4 Apache-2.0
2.2.0-dev.20260930000246.gd4b7f02 >=3 <4 Apache-2.0
2.2.0-dev.20260929230014.g97adf59 >=3 <4 Apache-2.0