smartlook / smartlook-client

Official Smartlook client for easy frontend integration.
https://smartlook.com
MIT License
28 stars 9 forks source link

[Smartlook] Smartlook is stopped. Automation framework is detected. #45

Closed frpz closed 7 months ago

frpz commented 10 months ago

Hello,

I've created a site with react and typescript using vite with this command: npm create vite@latest

then I installed the client with npm i smartlook-client

and added this to my App.tsx:

import Smartlook from "smartlook-client"
Smartlook.init("my_app_id", { region: "eu" })

but when the app loads, I have this error message in the console:

[Smartlook] Smartlook is stopped. Automation framework is detected.

I didn't find anything in the doc regarding this error message.

my project is very basic, just one page with no routing.

my package.json:

{
  "name": "monprofil",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "tsc && vite build",
    "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
    "preview": "vite preview"
  },
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "smartlook-client": "^8.3.0"
  },
  "devDependencies": {
    "@types/react": "^18.2.43",
    "@types/react-dom": "^18.2.17",
    "@typescript-eslint/eslint-plugin": "^6.14.0",
    "@typescript-eslint/parser": "^6.14.0",
    "@vitejs/plugin-react-swc": "^3.5.0",
    "eslint": "^8.55.0",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-refresh": "^0.4.5",
    "typescript": "^5.2.2",
    "vite": "^5.0.8"
  }
}

Any ideas how to get rid of this message?

Joozty commented 7 months ago

Hi @frpz 👋

Smartlook, by default, does not record sessions originating from browsers controlled by automation software. This detection is achieved through the navigator.webDriver property.

I don't see anything wrong with your example, but it seems like some information might be missing because when you execute npm run dev or npm run preview, it does not launch a controlled browser.

We offer an undocumented flag within the initialization options that you can utilize, but I wouldn't recommend using it unless it's for testing purposes. You can enable it by using Smartlook.init('<key>', {enableRecordingOfAutomationFrameworks: true}). However, you will need to suppress the TypeScript error as this flag is undocumented and intentionally omitted from the types.