Wave Up Developers FR

Front-end integration

The component is displayed in an iframe served by Wave Up. Your page never sees what is entered: it only receives events, without any health data.

Display the component

<div id="assessment"></div>
<script src="https://embed.waveup-health.fr/v1/sdk.js"></script>
<script>
  const ev = WaveUp.mount('#assessment', {
    clientToken: '…',   // received from your server
    locale: 'en-GB',    // optional: an allowed locale, otherwise the session's
    theme: 'auto',      // 'light', 'dark' or 'auto'
    height: 'auto',     // or a fixed CSS height
    minHeight: 640,     // in auto mode, in px (640 recommended for drawing)
  })
</script>

The SDK is also available as a module: npm install @waveup/sdk, then import { mount } from '@waveup/sdk'.

Events

Event Data When
ready — The session is loaded and the component displayed
step { step } Step change: cartography, questionnaires, review, done
lock — The patient takes the device: hide your navigation
unlock — The practitioner takes back control
completed { sessionId } The assessment was sent: retrieve the result server-side
cancelled — The component page was left while data was being entered
error { code, message } session_expired, invalid_token, already_submitted, network, unsupported_browser, internal
ev.on('lock', () => document.body.classList.add('patient-mode'))
ev.on('unlock', () => document.body.classList.remove('patient-mode'))
ev.on('error', ({ code }) => code === 'session_expired' && createNewSession())
const stop = ev.on('step', ({ step }) => console.log(step))
stop() // unsubscribe
ev.destroy() // remove the component

Size and full screen

Allowed domains

The iframe only displays on the domains declared for your account (frame-ancestors header). Send us all your domains, including staging ones.

Mobile apps (WebView)

The component works in an iOS (WKWebView) or Android WebView: load a page from your domain that uses the SDK. For sliders and drawing, disable page zoom (<meta name="viewport" content="width=device-width, initial-scale=1">).

Supported browsers

Recent versions of Safari (iPadOS, macOS), Chrome, Edge and Firefox. The component reports an outdated browser through the error event (unsupported_browser).