@Hitesh_G Generate API Key instead of Access Token from Dhan account and automate login using headless chrome. Follow API docs to maintain a proper login flow to receive an access token in the end.
You can automate the access token generation process using the API Key and Secret. This mechanism allows your system to seamlessly generate valid tokens without manual intervention.
You can upgrade the codebase version and use the pin+totp method which automatically generates access token without any manual effort, refer the below thread and follow the process to use that method -