Add it as a preset to your docusaurus config along with @docusaurus/preset-classic and pass options:
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import type * as Redocusaurus from 'redocusaurus';
const config: Config = {
presets: [
[
'@docusaurus/preset-classic',
{
googleAnalytics: {
trackingID: 'XXXXXX',
},
} satisfies Preset.Options,
]
[
'redocusaurus',
{
specs: [
{
spec: 'openapi/index.yaml',
route: '/api/',
},
{
spec: 'https://redocly.github.io/redoc/openapi.yaml',
route: '/openapi/',
},
],
theme: {
primaryColor: '#1890ff',
},
},
] satisfies Redocusaurus.PresetEntry,
],
};
export default config;