-
How to configure the client to use basic authentication if OpenAPI is behind basic auth? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
@ddhanak are you using the standalone client? (Fetch or Axios) |
Beta Was this translation helpful? Give feedback.
-
@mrlubos I am using the Axios client, here is my config: import { defineConfig } from "@hey-api/openapi-ts";
const DEFAULT_URL = "https://my.api.com";
export default defineConfig({
base: DEFAULT_URL,
plugins: ["@tanstack/react-query"],
client: {
name: "@hey-api/client-axios"
},
input: `${DEFAULT_URL}/openapi.json`,
output: {
path: "./api/client",
format: "prettier",
lint: "eslint"
},
types: {
enums: "typescript",
name: "PascalCase"
}
});
|
Beta Was this translation helpful? Give feedback.
-
I would try
|
Beta Was this translation helpful? Give feedback.
I never updated here but this has been possible to do for a while using
input.fetch
options https://heyapi.dev/openapi-ts/configuration/input#request-options