Build
SDK reference
Every option, method and script-tag attribute.
What the script adds to your page
| Global | Description |
|---|---|
window.Iungo | An object with init(options) and version. Always present once the script has loaded. |
window.iungoClient() | Returns the client the script tag created. Only exists when the script tag carries data-partner-key. |
Iungo.init(options)
Creates a client. Use it when you want more control than the script-tag attributes give you, for example to place the window inline. It must run in a browser. If the options are wrong it throws an error that says what to fix.
const iungo = Iungo.init({
partnerKey: 'pk_live_YOUR_KEY',
})| Option | Type | Default | Description |
|---|---|---|---|
partnerKey | string | required | Your partner key, pk_live_…. It identifies your site and is not a secret. |
mode | 'modal' | 'inline' | 'modal' | A modal opens over the page. inline fills container. |
container | Element | string | none | For inline: an element or a CSS selector. Required in that mode. |
theme | 'light' | 'dark' | iungo default | Forces the window's colour theme. |
locale | string | none | Accepted for the future. The window is English only for now. |
zIndex | number | 2147483000 | Stacking order of the modal. |
draggable | boolean | true | On larger screens the visitor can drag the call window aside by its grab strip, and during a call the dimmed backdrop goes away so your page stays usable behind it. Phones always get a full-screen window. Set false to keep the window fixed and the page dimmed. |
readyTimeoutMs | number | 15000 | Advanced. How long to wait for the window to load before reporting EMBED_TIMEOUT. At least 1000. |
The client
init and window.iungoClient() return the same kind of client.
| Method | Description |
|---|---|
openCall() | Opens the call window for your host: sign-up or log-in if needed, a top-up if the balance is low, then the call. |
openSignup() | Opens sign-up or log-in on its own. |
openTopUp() | Opens the wallet top-up on its own. |
close() | Closes the window. If a call is in progress the visitor is asked before it ends. |
signOut() | Signs the visitor out of iungo, whether or not the window is open. If it is closed, the SDK signs them out in a hidden frame and removes it. Visitors can also log out themselves with the “Log out” link inside the window. |
on(type, handler) | Listens for an event. Returns a function that stops listening. |
off(type, handler) | Stops listening. |
isOpen() | Whether the window is showing. |
destroy() | Removes everything the SDK added to your page. |
version | The SDK version, a string. |
The methods that open the window return a promise. It resolves when the window has accepted the request and rejects with an IungoError, which has code, message and retryable. Always branch on code, never on message.
const iungo = window.iungoClient()
document.querySelector('#talk').addEventListener('click', async () => {
try {
await iungo.openCall()
} catch (error) {
if (error.code === 'POPUP_BLOCKED') {
alert('Please allow pop-ups for this site to pay.')
} else {
console.error(error.code, error.message)
}
}
})Signing visitors out with your own site
A visitor's iungo session is kept inside the window, so logging out of your own site does not sign them out of iungo. Call signOut() when your site logs a user out, so the next person on a shared computer is not signed in as them:
// when your site logs its user out:
window.iungoClient()?.signOut().catch(() => {})It rejects with EMBED_TIMEOUT if the window cannot load (for example on a website that is not registered), so catch the error if you do not need to react to it.
Script tag attributes
| Attribute | Description |
|---|---|
data-partner-key | Required for the no-code setup. Your partner key. |
data-theme | light or dark. |
data-draggable | Set to false to turn off dragging (same as draggable). |
data-ready-timeout-ms | Advanced. Same as readyTimeoutMs. |
Buttons use data-iungo-call, data-iungo-signup and data-iungo-topup. See Installation.
Versions
The SDK follows semantic versioning. Breaking changes only come with a new major version, and the window keeps working with older SDK versions, so you upgrade when you choose. Iungo.version tells you which one is running.
Something missing or unclear? Tell us.

