Troubleshooting
The Screeb widget doesn't appear
- Check that
websiteIdmatches your channel ID in workspace settings. - Check the browser console for errors from
[@screeb/vue-sdk]. - Verify
shouldLoadis not set tofalsein the plugin config. - If using
autoInit: false, make sure you callinit()before any other Screeb method.
useScreeb returns undefined methods
useScreeb() must be called inside a component that is rendered within the app where ScreebPlugin is installed. If it returns undefined, you'll see a warning:
`useScreeb` must be called inside a component tree where ScreebPlugin is installed.
Make sure the plugin is installed with app.use(ScreebPlugin, ...) before mounting.
Methods reject with "Screeb has not been initialized"
This happens when you call a Screeb method before init() completes. Either:
- Set
autoInit: truein the plugin config, or - Wait for
init()to resolve before calling other methods.
Screeb loads but no surveys appear
- Check that your targeting rules match the current user (properties, events, URL).
- Use
targetingDebug()to inspect the current targeting state:
const { targetingDebug } = useScreeb();
console.log(await targetingDebug());
SSR / Nuxt compatibility
The Vue SDK guards against SSR with an isSSR check — load() is not called on the server. For Nuxt, install the plugin only on the client side:
// plugins/screeb.client.ts
import { ScreebPlugin } from "@screeb/sdk-vue";
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(ScreebPlugin, {
websiteId: "<YOUR-CHANNEL-ID>",
autoInit: true,
});
});
The .client.ts suffix ensures Nuxt only runs this plugin in the browser.