|
| 1 | +--- |
| 2 | +title: Mobile Mode |
| 3 | +sidebarTitle: Mobile Mode |
| 4 | +description: Create browser sessions that appear as mobile devices with full mobile fingerprints and touch capabilities. |
| 5 | +llm: false |
| 6 | +--- |
| 7 | + |
| 8 | +### Overview |
| 9 | + |
| 10 | +Mobile mode allows Steel sessions to appear as mobile devices. Pass `deviceConfig: { device: "mobile" }` when creating a session and the browser presents itself with mobile user agent, viewport, touch capabilities, and browser characteristics—everything aligned to look like a phone instead of desktop. |
| 11 | + |
| 12 | +Most websites serve fundamentally different experiences to mobile devices. Desktop sites have nested navigation, hover menus, and complex interactions. Mobile sites strip these away into linear flows and touch-optimized interfaces. For AI agents, this simplification can directly improve task completion. |
| 13 | + |
| 14 | +### How It Works |
| 15 | + |
| 16 | +<CodeTabs storage="languageSwitcher"> |
| 17 | + |
| 18 | +```typescript !! Typescript -wcn |
| 19 | +import Steel from 'steel-sdk'; |
| 20 | +import { chromium } from 'playwright'; |
| 21 | + |
| 22 | +const client = new Steel({ steelAPIKey: process.env.STEEL_API_KEY }); |
| 23 | + |
| 24 | +// Create a session with mobile device configuration |
| 25 | +const session = await client.sessions.create({ |
| 26 | + deviceConfig: { device: "mobile" } |
| 27 | +}); |
| 28 | + |
| 29 | +// Connect to the mobile session |
| 30 | +const browser = await chromium.connectOverCDP( |
| 31 | + `wss://connect.steel.dev?apiKey=${process.env.STEEL_API_KEY}&sessionId=${session.id}` |
| 32 | +); |
| 33 | + |
| 34 | +const page = await browser.contexts()[0].pages()[0]; |
| 35 | +await page.goto('https://example.com'); |
| 36 | +``` |
| 37 | + |
| 38 | +```python !! Python -wcn |
| 39 | +from steel import Steel |
| 40 | +from playwright.async_api import async_playwright |
| 41 | +import os |
| 42 | + |
| 43 | +client = Steel(steel_api_key=os.environ.get("STEEL_API_KEY")) |
| 44 | + |
| 45 | +# Create a session with mobile device configuration |
| 46 | +session = client.sessions.create( |
| 47 | + device_config={"device": "mobile"} |
| 48 | +) |
| 49 | + |
| 50 | +# Connect to the mobile session |
| 51 | +async with async_playwright() as p: |
| 52 | + browser = await p.chromium.connect_over_cdp( |
| 53 | + f"wss://connect.steel.dev?apiKey={os.environ.get('STEEL_API_KEY')}&sessionId={session.id}" |
| 54 | + ) |
| 55 | + |
| 56 | + page = browser.contexts[0].pages[0] |
| 57 | + await page.goto('https://example.com') |
| 58 | +``` |
| 59 | + |
| 60 | +</CodeTabs> |
| 61 | + |
| 62 | +The session automatically configures mobile viewport dimensions, touch events, and a full mobile device fingerprint. Sites see a consistent mobile device visiting from a browser app, not a desktop browser with a spoofed user agent. Before this, you could override the user agent string, but the rest of the fingerprint wouldn't match—sites would detect the inconsistency. |
| 63 | + |
| 64 | +Mobile mode works with all existing features including proxies, CAPTCHA solving, and session persistence. |
| 65 | + |
| 66 | +### Why This Matters |
| 67 | + |
| 68 | +**Simplified Navigation** |
| 69 | + |
| 70 | +Mobile sites present content sequentially rather than using nested menus or hover states. An e-commerce checkout that requires navigating dropdown menus on desktop becomes a vertical list on mobile. Fewer interactive elements means clearer action spaces and less chance of mistakes. |
| 71 | + |
| 72 | +**Performance and Cost Benefits** |
| 73 | + |
| 74 | +Mobile sites load faster with fewer widgets and less aggressive lazy-loading. They also have simpler DOM structures. Less HTML for your model to process means lower token costs. If you're using vision, it means fewer image tokens too. |
| 75 | + |
| 76 | +**Consistent Fingerprints** |
| 77 | + |
| 78 | +Without mobile mode, your sessions use desktop fingerprints by default. Mobile mode provides a complete, consistent mobile device fingerprint that websites trust. |
| 79 | + |
| 80 | +:::callout |
| 81 | +type: help |
| 82 | +### Need help with mobile mode? |
| 83 | +Reach out to us on the <span className="font-bold">#help</span> channel on [Discord](https://discord.gg/steel-dev) or [@steeldotdev](https://twitter.com/steeldotdev). |
| 84 | + |
| 85 | +Part of Steel's launch week. More at [steel.dev/launch-week](https://steel.dev/launch-week). |
| 86 | +::: |
0 commit comments