2.2 KiB
When writing the docs, always make sure to add it to docs.json for it to appear
React Hook Documentation
Always read the actual types in packages/autumn-js/src/ before writing hook docs:
- Hook params:
packages/autumn-js/src/react/hooks/<hookName>.ts - Client params:
packages/autumn-js/src/types/params.ts - SDK types:
packages/sdk/src/models/
Casing: The TypeScript SDK uses camelCase (Speakeasy transforms snake_case API responses). All JSON examples in docs must use camelCase (planId, createdAt, featureId).
Keep it concise: Only document the most important parameters. Link to API reference for the full list.
Manual API Documentation
Manual documentation (explanations, examples, use cases) should go in api-reference-generator/ folder, NOT in mintlify/api-reference/. The generator merges manual content from api-reference-generator/ with auto-generated body params and outputs the final result to mintlify/api-reference/.
Workflow:
- Create/edit manual docs in
apps/docs/api-reference-generator/<category>/<operationId>.mdx - Run the generator to merge with generated params
- Output goes to
apps/docs/mintlify/api-reference/<category>/<operationId>.mdx
Never edit files directly in mintlify/api-reference/ - they will be overwritten by the generator.
DynamicParamField Component
Location: snippets/dynamic-param-field.jsx
Purpose: Wrapper around Mintlify's ParamField that auto-converts param names between snake_case and camelCase based on selected code language.
Behavior:
- TypeScript/Node.js → camelCase (
customerId) - Python/cURL/others → snake_case (
customer_id)
How it works:
- Reads
codekey from localStorage (set by Mintlify's language selector) - Listens for
mintlify-localstorageevent + polls every 500ms as fallback - Transforms
bodyandpathprops using regex:str.replace(/[_-](\w)/g, ...)
Usage:
import { DynamicParamField } from "/snippets/dynamic-param-field.jsx";
<DynamicParamField body="customer_id" type="string" required>
The customer identifier
</DynamicParamField>
Always pass snake_case to the component - it handles camelCase conversion automatically.