const ui = SwaggerUIBundle({ url: "https://my.api.com/swagger.yaml", ... onComplete: function() { // "basicAuth" is the key name of the security scheme in securityDefinitions ui.preauthorizeBasic("basicAuth", "username", "password"); } })