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.
Quick start
Section titled “Quick start”1. Get your API key and embed code
Section titled “1. Get your API key and embed code”In FromUsers:
- Open an in-product survey.
- Go to the Integration Guide tab.
Copy the embed code — it includes your organization API key and the correct script URL.
2. Add the script to your site
Section titled “2. Add the script to your site”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).
3. Publish a live survey
Section titled “3. Publish a live survey”- 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.
What happens automatically
Section titled “What happens automatically”After the script loads, FromUsers:
- Loads active surveys for your organization
- Checks URL rules, frequency caps, and triggers
- Shows the survey (modal, banner, embedded, or toast)
- Records an impression when displayed
- Saves answers when the participant submits
You do not need to call any code for the default experience.
Optional: JavaScript API
Section titled “Optional: JavaScript API”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 eventFromUsers.trackEvent('checkout_completed', { orderValue: 99.99,});The Integration Guide tab includes React and other framework examples.
Security
Section titled “Security”- Keep your API key in environment variables or server config — not in public Git repos.
- The key identifies your organization, not individual end users.
Testing
Section titled “Testing”- Use a Live survey with permissive targeting (e.g. URL contains
localhost). - Set a simple trigger (time on page).
- Turn on
debug: trueinFromUsers.init()to see logs in the browser console. - Use Preview in FromUsers to validate questions before going live.
Troubleshooting
Section titled “Troubleshooting”| Issue | Check |
|---|---|
| Survey never appears | Survey is Live; URL matches targeting; trigger fires |
| Wrong survey | Multiple live surveys — review priority and quarantine rules |
| No impressions in results | Script installed on production URL; ad blockers disabled for testing |