Embedding a Survey

Learn how to embed SenseFolks surveys in different environments and frameworks. Each example includes complete, copy-paste code.

⏱️ Estimated time: 10 minutes

Vanilla HTML (No Framework)

The simplest way to embed a survey — just two lines of code:

html
<!DOCTYPE html>
<html>
<head>
  <script type="module" src="https://unpkg.com/@sensefolks/fastpoll"></script>
</head>
<body>
  <sf-fastpoll survey-key="your-uuid"></sf-fastpoll>
</body>
</html>

React

jsx
import '@sensefolks/fastpoll';

function SurveyPage() {
  return (
    <div>
      <h1>We'd love your feedback</h1>
      <sf-fastpoll survey-key="your-uuid" />
    </div>
  );
}

For TypeScript, add type declarations in a .d.ts file.

Vue

vue
<template>
  <div>
    <h1>We'd love your feedback</h1>
    <sf-fastpoll survey-key="your-uuid" />
  </div>
</template>

<script setup>
import '@sensefolks/fastpoll';
</script>

Configure Vue to recognize custom elements by adding isCustomElement to your Vue config for tags starting with sf-.

Angular

Add CUSTOM_ELEMENTS_SCHEMA to your module:

typescript
import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
import '@sensefolks/fastpoll';

@NgModule({
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
})

Next Steps