How to automate app to chrome/safari browser flow using selenium webdriver in JavaScript

Hello Everyone,
I have been working upon automating a cordova hybrid app.
My use case consist of clicking a login url which opens the login page in device browser like chrome and Safari. I need to automatically key in the username and password.

My setup consists following:

  • Appium (v1.17)
  • Selenium Webdriver with Typescript
  • Andorid and iOS environments

My Sample Code Setup:

    "androidDesiredCapabilities": {
    "platformName": "Android",
    "platformVersion": "10",
    "deviceName": "Pixel 3",
    "app": "app-debug.apk",
    "automationName": "Appium",
    "browserName": "",
    "autoWebview": true

const serverAddress = "";
const driver = new Builder().usingServer(serverAddress).withCapabilities(capabilities.androidDesiredCapabilities).build();

How can I get hold of the browser window. Any help will be much appreciated