Skip to main content
The Uplink iOS SDK embeds a worker inside your iOS app, making the device controllable from server-side code written with the JavaScript SDK. Use it when you want Uplink automation to run inside your own branded app.
Key concepts:
  • Device: A physical iOS device running your app
  • Worker: A worker created by the Uplink SDK inside your app (one app can create multiple workers)
  • Session: An authenticated connection that pairs your worker with a JavaScript SDK client

Requirements

  • iOS 15.0 or later
  • Xcode 26 or later

Installation

The iOS SDK is distributed via Swift Package Manager.
1

Add the package

In Xcode, go to File → Add Package Dependencies… and enter:
2

Select the Uplink product

Choose the Uplink library product and add it to your app target. It bundles its MuppetIOS browser engine dependency, so you only link one product.Choose Uplink-Dynamic instead only when your integration requires dynamic frameworks.
3

Import the module

If you manage dependencies with a Package.swift file:

Quick example

Creating a worker

Worker(controller:)

Worker is an actor. Its initializer is async and binds the worker to a UIViewController. The SDK uses the controller to host its WKWebView, so pass the view controller that should own the SDK’s browser surface (typically the one currently on screen).
Parameters:
  • controller: The UIViewController that will host the SDK’s web view
Create one worker per session. There is no shared Uplink object to configure first.
Keep a strong reference to the Worker for as long as the connection is active. If the worker is deallocated, the session will close.

Obtaining a session

Your backend creates a session using the JavaScript SDK’s uplink.session() and delivers the resulting session URL to the app. How you deliver it — a backend API response, a universal link, a QR code — is up to you.
See Sessions for how sessions are created on the server side.

Connecting and accepting

worker.connect(session:)

Connects the worker to an Uplink session.
Parameters:
  • session: The session URL provided by your backend
Throws: UplinkError.unableToConnectToUplink if the session can’t be joined.

worker.accept()

Begins accepting commands from the JavaScript SDK client. accept() does not throw, and it suspends until the worker closes, so call it from a Task if you want the rest of your app to continue running.

Watching events

worker.watch(_:)

Registers a callback for events the worker emits. Call it before connect so you don’t miss the connection events.
Events are enums that conform to Event. Match on the ones you care about:

Cleanup

worker.close()

Closes the worker and releases its resources. Returns once the session has finished closing.
Closing a worker ends its session. Any browsers the JavaScript SDK has launched on the worker will be terminated.

Debug logging

UplinkDebug.setDebug(isEnabled:forwardLogs:) turns on verbose SDK logging and optionally forwards each line to your own logger.

Complete example

A minimal UIViewController that starts an Uplink worker when it appears:

Android SDK

Integrate Uplink into your Android app

JavaScript SDK

Control your worker from server-side code

Sessions

How sessions are created and secured

Core concepts

Architecture overview