Papercuts supports both Playwright and Puppeteer scripts to take action on your users behalf.

After users link their accounts to your app, you can access their sessions and run custom scripts, mimicking user interactions with the target websites.

Execute an automation script

First retrieve a webSocketUrl to Playwright instance with the user’s session using create session endpoint. An example is shown here for LinkedIn.

Response
{
  "status": "ok",
  "webSocketUrl": "string"
}

Use the webSocketUrl received in response to connect with the Playwright instance using Chrome DevTools Protocol (CDP).

Connect to a playwright instance

const browser = await chromium.connectOverCDP(webSocketUrl)
const context = browser.contexts()[0]
const page = await context.newPage()
await page.goto("https://www.linkedin.com")
await page.waitForLoadState("networkidle")
console.log(await page.title()); // Page is ready to use.
// Your automation script here
await browser.close()

This sample sets up a browser context mirroring the user’s session and runs a script to navigate directly to LinkedIn’s page.

You can then interact with the page as if you were the user, enabling actions like:

Next Steps

API References