SurveyJS
This integration provides a full integration with SurveyJS, a powerful JavaScript library for creating dynamic forms and surveys. Unlike other integrations located in packages/integrations, SurveyJS is implemented as a separate module that can be added to the API Harmonization server.
In this section
- How to set up - Step-by-step guide for setting up the SurveyJS integration
- Features - Overview of features supported by the SurveyJS integration
- Usage - Examples and best practices for using SurveyJS
Installation
First, install the SurveyJS module package:
npm install @o2s/modules.surveyjs --workspace=@o2s/api --workspace=@o2s/frontend
Environment variables
Configure the following environment variables in your API Harmonization server:
| name | type | description | required |
|---|---|---|---|
| API_SURVEYJS_BASE_URL | string | the base URL pointing to the SurveyJS service | yes |
You can obtain this value from your SurveyJS instance settings - it should be the URL where your SurveyJS server is running (e.g., https://api.surveyjs.io for production or http://localhost:3000 for local development).
Module Structure
The SurveyJS module is structured into three main parts:
-
API Harmonization: Server-side integration that provides:
- Controllers for handling HTTP requests
- Services for business logic
- Data models and mappers
- Form submission and validation
-
Frontend: Client-side integration that provides:
- React components for rendering surveys
- Form elements and question types
- Submission handling
-
SDK: Software development kit that provides:
- Helper functions for working with SurveyJS
- Integration utilities
Quick start
- Install the package (see How to set up)
- Configure environment variables
- Register the module in your API Harmonization server
- Use the
Surveycomponent in your frontend application
For detailed instructions, see the How to set up guide.