Skip to content

SDK integration

The FromUsers SDK is a small script you add to your website. It shows in-product surveys when your targeting and trigger rules match.

In FromUsers:

  1. Open an in-product survey.
  2. Go to the Integration Guide tab.

Copy the embed code — it includes your organization API key and the correct script URL.

Paste the snippet before the closing </body> tag on pages where surveys should run:

<script
src="https://YOUR_API_HOST/fromusers-sdk.js"
data-api-key="YOUR_ORG_API_KEY"
async
></script>

Use the exact src and data-api-key from the Integration Guide (your host may differ in staging vs production).

  • Set the survey to Live
  • Configure page targeting so it matches the URL you are testing
  • Add a trigger (e.g. show after 10 seconds on page)

Visit that page in your browser to confirm the survey appears.

After the script loads, FromUsers:

  1. Loads active surveys for your organization
  2. Checks URL rules, frequency caps, and triggers
  3. Shows the survey (modal, banner, embedded, or toast)
  4. Records an impression when displayed
  5. Saves answers when the participant submits

You do not need to call any code for the default experience.

For custom triggers or advanced setups:

FromUsers.init({
apiKey: 'YOUR_ORG_API_KEY',
userId: 'user-123',
debug: false,
userAttributes: {
plan: 'premium',
},
});
// Trigger a survey rule tied to a custom event
FromUsers.trackEvent('checkout_completed', {
orderValue: 99.99,
});

The Integration Guide tab includes React and other framework examples.

  • Keep your API key in environment variables or server config — not in public Git repos.
  • The key identifies your organization, not individual end users.
  1. Use a Live survey with permissive targeting (e.g. URL contains localhost).
  2. Set a simple trigger (time on page).
  3. Turn on debug: true in FromUsers.init() to see logs in the browser console.
  4. Use Preview in FromUsers to validate questions before going live.
IssueCheck
Survey never appearsSurvey is Live; URL matches targeting; trigger fires
Wrong surveyMultiple live surveys — review priority and quarantine rules
No impressions in resultsScript installed on production URL; ad blockers disabled for testing