Skip to main content
Version: Svelte SDK

Troubleshooting

The Screeb widget doesn't appearโ€‹

  1. Check that websiteId matches your channel ID in workspace settings.
  2. Check the browser console for errors from @screeb/sdk-svelte.
  3. Verify shouldLoad is not set to false in the provider config.
  4. If using autoInit: false, make sure you call init() before any other Screeb method.

useScreeb returns undefined methodsโ€‹

useScreeb() must be called inside a component that is rendered under the component where setScreebContext is called. If it returns undefined, you'll see a warning:

`useScreeb` must be called inside a component tree where `setScreebContext` or `provideScreeb` has been called.

Make sure setScreebContext(...) is called in a parent component before using useScreeb().

Methods reject with "Screeb has not been initialized"โ€‹

This happens when you call a Screeb method before init() completes. Either:

  • Set autoInit: true in the provider 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 / SvelteKit compatibilityโ€‹

The Svelte SDK guards against SSR with an isSSR check, so load() is not called on the server. In SvelteKit, call setScreebContext from a browser-rendered root layout or page component:

<!-- +layout.svelte -->
<script lang="ts">
import { setScreebContext } from "@screeb/sdk-svelte";

setScreebContext({
websiteId: "<YOUR-CHANNEL-ID>",
autoInit: true,
});
</script>

<slot />

Use shouldLoad: false in tests or CI if you do not want the Screeb tag to be injected.