Skip to main content
Prerequisites:
  • Node.js version 16 or higher
  • An Uplink account (sign up at console.uplink.build)
  • A mobile device with the Connect app installed, or your own app with the SDK integrated
This guide will walk you through setting up your first Uplink automation session.

Step 1: Install the JavaScript SDK

Install the Uplink SDK in your project:
npm install @uplink-code/uplink

Step 2: Create a session

Log in to your Uplink Console and create a new automation session.
1

Generate API key

Navigate to SettingsAPI Keys and create a new API key
2

Create session

Go to SessionsNew Session to generate a session JWT token
3

Copy session URL

Copy the WebSocket URL in the format: wss://relay.uplink.build/session/<jwt>
Session tokens are scoped to specific permissions and can be configured with expiration times for security.

Step 3: Connect a device

Choose your integration method:
  • Connect App (Quick)
  • SDK Integration
1

Install Connect app

Download the Uplink Connect app from the App Store or Play Store
2

Join session

In the Console, get the QR code or session code for your session, then scan it or enter it in the Connect app
3

Verify connection

You should see the device appear as “connected” in your Console

Step 4: Run your first automation

Create a new JavaScript file and add the following code:
import uplink from '@uplink-code/uplink'

async function main() {
  // Connect to your session
  const client = await uplink.client.connect('wss://relay.uplink.build/session/<your-jwt>')

  console.log('Connected to Uplink!')

  // Wait for a device to connect
  const device = await client.worker()
  console.log('Device connected:', device.address)

  // Launch a browser
  const browser = await client.launch()
  const page = await browser.newPage()

  // Navigate to a website
  await page.goto('https://example.com')
  console.log('Navigated to example.com')

  // Get the page title
  const title = await page.evaluate(() => document.title)
  console.log('Page title:', title)

  // Take a screenshot
  const screenshot = await page.screenshot()
  console.log('Screenshot captured!')

  // Clean up
  await page.close()
  await browser.close()
  await client.close()

  console.log('Done!')
}

main().catch(console.error)
Replace <your-jwt> with the session token from your Console, then run:
node your-script.js

What’s next?

Example use cases

Once you’re comfortable with the basics, try these common automation scenarios:
await page.goto('https://app.example.com/login')

// User logs in on their device (handles 2FA, CAPTCHA, etc.)
await page.waitForAuthentication(
  async (page) => {
    const url = await page.url()
    return url.includes('/dashboard')
  },
  { timeout: 120000 }
)

// Now automate actions in the authenticated session
await page.click('#export-button')
await page.goto('https://example.com/products')
const products = await page.evaluate(() => {
  return Array.from(document.querySelectorAll('.product')).map(el => ({
    name: el.querySelector('.name').textContent,
    price: el.querySelector('.price').textContent
  }))
})
console.log(products)
await page.on('xhr', async (event) => {
  const request = event.data
  if (request.url.includes('/api/')) {
    console.log('API call:', request.method, request.url)
    if (request.response) {
      console.log('Status:', request.response.status)
    }
  }
})

await page.goto('https://app.example.com')