@stainlessdev/docs-xray
v0.1.0
Published
Turbocharge your Stainless Docs with Request Logs!
Downloads
96
Readme
@stainlessdev/docs-xray
Turbocharge your Stainless Docs with Request Logs!
Install
pnpm add @stainlessdev/docs-xrayBasic usage
Configure astro.config.ts like:
import { xrayIntegration } from "@stainlessdev/docs-xray/integration";
export default defineConfig({
integrations: [
xrayIntegration({ xrayApi: process.env.XRAY_API }),
stainlessDocs({
// ...
tabs: [
// ...
{
label: "X-ray",
link: "/xray",
},
],
}),
],
});Create an Astro page for xray, like src/pages/xray.astro:
---
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
import { XRayPageSetup } from '@stainlessdev/docs-xray';
import { CMS_PORT, BASE_PATH } from 'virtual:stl-starlight-virtual-module';
const XRAY_API = import.meta.env.XRAY_API || null;
---
<StarlightPage
frontmatter={{
title: 'X-ray',
pagefind: false,
tableOfContents: false,
template: 'splash',
}}
headings={[]}
>
<XRayPageSetup
xrayApi={XRAY_API}
cmsPort={CMS_PORT}
basePath={BASE_PATH}
/>
</StarlightPage>