Gets what kind of device is being used to view the page.
Note: This property only checks the site visitor's device, and not which Studio Editor's breakpoint they are using.
The formFactor
property gets one of:
"Desktop"
: When viewed in a desktop browser."Mobile"
: When viewed in a mobile browser."Tablet"
: When viewed in a tablet browser.Important: Some tablet devices (such as iPads) are identified in this property as "Desktop".
function formFactor(): Promise<string>;
import { createClient } from "@wix/sdk";
import { site } from "@wix/site";
import { window as wixWindow } from "@wix/site-window";
const wixClient = createClient({
host: site.host(),
modules: { wixWindow },
});
// ...
let formFactor = await wixClient.wixWindow.formFactor(); // "Mobile"
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.