Skip to content

Build

Installation

Add the SDK with a script tag, from a framework, or on a site builder.

Script tag

The script tag is the supported way to install the SDK and works on any site. Put it before the closing </body> tag:

html
<script src="https://iungo.app/sdk/iungo-sdk-0.2.0.js" data-partner-key="pk_live_YOUR_KEY" async></script>

Then mark up the buttons. Any element works, and you can add as many as you like:

html
<button data-iungo-call>Call</button>
<a href="#" data-iungo-signup>Create an iungo account</a>
<button data-iungo-topup>Add credit</button>
AttributeOpens
data-iungo-callThe call window: sign-up or log-in if needed, a top-up if the balance is low, then the call.
data-iungo-signupSign-up or log-in on its own.
data-iungo-topupThe wallet top-up on its own.

Pinned and latest files

FileUse it for
/sdk/iungo-sdk-0.2.0.jsProduction. The version is in the name and the file never changes.
/sdk/iungo-sdk.jsTrials only. Always the newest release, cached for a few minutes.

When a new version is released we tell you what changed in the changelog. You move to it by changing the number in the file name.

React, Next.js and other frameworks

Add the script once and keep using data-iungo-call on your buttons. The script listens for clicks on the whole page, so buttons your framework renders later still work.

React
import { useEffect } from 'react'

export function IungoCallButton({ partnerKey, children = 'Call' }) {
  useEffect(() => {
    if (document.querySelector('script[data-iungo]')) return // load it once
    const script = document.createElement('script')
    script.src = 'https://iungo.app/sdk/iungo-sdk-0.2.0.js'
    script.async = true
    script.dataset.partnerKey = partnerKey
    script.dataset.iungo = ''
    document.body.appendChild(script)
  }, [partnerKey])

  return <button data-iungo-call>{children}</button>
}
Next.js (app router)
import Script from 'next/script'

// in your root layout, once:
<Script
  src="https://iungo.app/sdk/iungo-sdk-0.2.0.js"
  data-partner-key="pk_live_YOUR_KEY"
  strategy="afterInteractive"
/>

// anywhere in your pages:
<button data-iungo-call>Call</button>

WordPress, Webflow, Wix, Squarespace and other site builders

Use whatever your platform offers for adding custom code or an HTML block. Add the script tag to the footer (or “before </body>”) code area for the whole site, and put the button in an HTML or embed block where you want it:

html
<button data-iungo-call>Call</button>

Some builders strip scripts or restrict custom code on certain plans, so check that yours allows it.

Showing the window inside your page

By default the window opens as a modal over the page. To place it inside an element of your own instead, use the JavaScript API with mode: 'inline':

html
<div id="call-here" style="width: 420px; height: 640px"></div>
<button id="start">Call</button>

<script src="https://iungo.app/sdk/iungo-sdk-0.2.0.js"></script>
<script>
  const iungo = Iungo.init({
    partnerKey: 'pk_live_YOUR_KEY',
    mode: 'inline',
    container: '#call-here',
  })
  document.getElementById('start').addEventListener('click', () => iungo.openCall())
</script>

Give the container a height. The window fills it. See the SDK reference for all options.

Content-Security-Policy and permissions

If your site sets security headers, allow iungo:

  • Content-Security-Policy: allow https://iungo.app in script-src (for the SDK file) and in frame-src (for the window). The SDK sets its styles through the DOM, so it needs no style-src exception.
  • Permissions-Policy: do not block microphone or camera for https://iungo.app, or video calls cannot start.
  • HTTPS: required for your site (except localhost during development).

Something missing or unclear? Tell us.