JavaScript widget
For external sites, use the Three Levers Flow Embed script with FlowIframeEmbed.
Overview
Section titled “Overview”- Install FlowIframeEmbed in Salesforce and expose FlowIframeEmbed on a Site.
- Define
window.tlFlowEmbedon your external page. - Load
three-levers-flow-embed.js. - The script builds query string (
flow,endUrl,inputVars) and resizes iframe fromframeHeightmessages.
Configure window.tlFlowEmbed
Section titled “Configure window.tlFlowEmbed”Define config before loading the script:
<div id="tl-flow-embed"></div>
<script> window.tlFlowEmbed = { embedUrl: 'https://your-site.force.com/site-prefix/FlowIframeEmbed', flow: 'Check_In_Dispatch', endUrl: 'https://yoursite.com/thanks', inputVars: ['recordId', 'source'], params: { recordId: '001xxx', source: 'homepage' }, height: '75px', heightPadding: 20, ease: true, easeSpeed: 0.2, lazy: true, allowedOrigin: 'https://your-site.force.com' };</script>Load the script
Section titled “Load the script”<script src="https://cdn.jsdelivr.net/gh/jason-best/lightning-flow-iframe@v1.0.0/embed/three-levers-flow-embed.js" type="text/javascript"></script>Or download from the v1.0.0 release.
Source: github.com/jason-best/lightning-flow-iframe
Three Levers hosted copy:
<script src="https://threelevers.com/assets/embed/three-levers-flow-embed.v1.js" type="text/javascript"></script>Options
Section titled “Options”| Property | Description | Required | Default |
|---|---|---|---|
embedUrl | Site URL to FlowIframeEmbed (no query string) | Yes | ? |
flow | Flow API Developer Name | Yes | ? |
endUrl | Redirect URL when flow finishes | No | ? |
inputVars | Names of query params to pass as flow String inputs | No | none |
params | Object of values for flow inputs (keys must be in inputVars) | No | ? |
container | CSS selector or element id for mount point | No | #tl-flow-embed |
height | Initial iframe height | No | 75px |
heightPadding | Extra pixels added to reported height | No | 20 |
ease | Smooth height transitions | No | false |
easeSpeed | Transition time in seconds | No | 0.2 |
lazy | loading=\"lazy\" on iframe | No | false |
allowedOrigin | Restrict postMessage to this origin | No | all origins |
See also: Querystring variables � Finish URL
Legacy ifc widget
Section titled “Legacy ifc widget”Older docs used ifc and lighningiFrame.js. That script forwarded full parent query strings and used endurl (lowercase).
Current FlowIframeEmbed requires:
flow(API name)endUrl(camelCase)- explicit
inputVarsallowlist
| Legacy | Current |
|---|---|
ifc.iframeurl | embedUrl |
ifc.endurl | endUrl |
ifc.extraqs | params + inputVars |
| Auto parent query string | Explicit params only |