Skip to content

episerver/content-headless-form-js-sdk

Repository files navigation

Headless Form JS SDK (beta release)

This is a JS SDK package that helps render a form based on metadata taken from the Headless Form API. In this package, there are 2 main parts:

Project Description
@episerver/forms-sdk JS SDK for models, client validation, form loader, form dependencies, form submit
@episerver/forms-react React SDK for rendering a form as a React component

ref: https://docs.developers.optimizely.com/content-management-system/v1.2.0-forms/docs/get-started-with-headless-optimizely-forms

Getting Started

Installation

From Azure Artifacts

Source https://dev.azure.com/EpiserverEngineering/netCore/_artifacts/feed/headless_forms_beta

To use packages from Azure Artifacts, configure your project to reference this feed. Create a new text file called .npmrc in the same directory as your package.json, then copy the snippet below.

   @episerver:registry=https://pkgs.dev.azure.com/EpiserverEngineering/netCore/_packaging/headless_forms_beta/npm/registry/

Install from the command line

   $ npm install @episerver/forms-sdk@%verion%
   $ npm install @episerver/forms-react@%verion%

OR clone source code and install dependencies, then build and view the site on the browser.

  1. Clone repo
   git clone https://github.com/episerver/content-headless-form-js-sdk.git
   cd content-headless-form-js-sdk
  1. Install package dependencies and database
   npm run setup

To setup musicfestival:

  1. Build all projects
   npm run build
  1. Start management site
   npm run start-backend

for musicfestival sample site

   npm run start-musicfestival-backend
  1. Start react site
   npm run start-frontend

for musicfestival sample site

   npm run start-musicfestival

View site on browser

Create a form with some elements in MainContentArea of Start page.

  1. Management page
   http://localhost:8082/episerver/cms
  1. React page
   http://localhost:3000/