@survicate/survicate-web-package
TypeScript icon, indicating that this package has built-in type declarations

24.2.0-npm • Public • Published

Survicate Web Package

This package allows you to run a web survey directly in your code. It's built on top of Preact using Typescript and CSS Modules.

Installation

npm install @survicate/survicate-web-package --save

Initialization

Find your workspace key in the Survicate Panel.

import Survicate from '@survicate/survicate-web-package/survicate_widget'

const key = "..." // Your key from the panel
Survicate.init({workspaceKey: key});

Examples:

To call available methods:

import Survicate from '@survicate/survicate-web-package/survicate_widget'

// Initialize survicate:
const key = "..." // Your key from the panel
Survicate.init({workspaceKey: key});

// Show survey with force option
Survicate.showSurvey('surveyId', { forceDisplay: true });

// Set user attributes
Survicate.setVisitorTraits({name: 'userName', lastName: 'userLastName'});

// Add event listener
Survicate.addEventListener(ApiEvent.questionAnswered , () => console.log('question answered'));

// Remove eventListener
Survicate.removeEventListener(ApiEvent.questionAnswered);

Please refer to the documentation for the rest of the methods.

Changelog

The Survicate JavaScript SDK changelog can be found here

Readme

Keywords

none

Package Sidebar

Install

npm i @survicate/survicate-web-package

Weekly Downloads

1,957

Version

24.2.0-npm

License

MIT

Unpacked Size

621 kB

Total Files

4

Last publish

Collaborators

  • katarzyna.c
  • janek.survi
  • jakub-k
  • pawelgodlewski
  • jarek_survi