Options Reference
Everything here is optional. These work with both createTranscript() and generateTranscriptHtml() unless noted otherwise.
Fetch Options
info
These options only apply to createTranscript().
| Option | Type | Default | Description |
|---|---|---|---|
limit | number | 100 | Number of messages to fetch (max: 5000) |
before | string | - | Fetch messages before this message ID |
after | string | - | Fetch messages after this message ID |
filename | string | auto | Custom filename for the output |
returnBuffer | boolean | - | Return as Buffer |
resolveRoles | boolean | true | Resolve member roles for colored usernames |
Display Options
| Option | Type | Default | Description |
|---|---|---|---|
theme | "dark" | "light" | "dark" | Color theme |
compact | boolean | false | Compact message layout |
dateFormat | "relative" | "absolute" | "both" | "absolute" | Timestamp format |
maxImageWidth | number | 400 | Maximum image width in pixels |
showReactions | boolean | true | Show message reactions |
showAvatars | boolean | true | Show user avatars |
showTimestamps | boolean | true | Show message timestamps |
showRoleColors | boolean | true | Color usernames by role |
showEmbeds | boolean | true | Render embeds |
showAttachments | boolean | true | Render attachments |
showThreads | boolean | true | Show thread indicators |
showHeader | boolean | true | Show channel header |
Feature Toggles
All of these are off by default. Turn on the ones you want.
| Option | Type | Default | Description |
|---|---|---|---|
enableSearch | boolean | false | Add message search bar |
enableDateNav | boolean | false | Add jump-to-date navigation |
showUserStats | boolean | false | Show user statistics section |
enableCopyButton | boolean | false | Show copy button on hover |
collapsibleEmbeds | boolean | false | Make embeds collapsible |
enableLightbox | boolean | false | Click images to view full-size |
expandThreads | boolean | false | Show expandable thread messages |
includeJson | boolean | false | Embed raw JSON data in output |
messagesPerPage | number | - | Enable pagination (messages per page) |
Customization
| Option | Type | Default | Description |
|---|---|---|---|
customCss | string | - | Additional CSS to inject |
fontFamily | string | - | Override font family |
pageTitle | string | auto | Custom page <title> |
faviconUrl | string | - | Custom favicon URL |
customRenderers | Record<number, Function> | - | Custom component renderers |
Custom CSS Example
const html = generateTranscriptHtml(data, {
customCss: `
.discord-dark {
--dc-bg-primary: #1a1a2e;
--dc-accent-primary: #e94560;
}
`,
});
Custom Font Example
const html = generateTranscriptHtml(data, {
fontFamily: "'Fira Code', monospace",
});
All Options at a Glance
const html = generateTranscriptHtml(data, {
// Display
theme: "dark",
compact: false,
dateFormat: "absolute",
maxImageWidth: 400,
showReactions: true,
showAvatars: true,
showTimestamps: true,
showRoleColors: true,
showEmbeds: true,
showAttachments: true,
showThreads: true,
showHeader: true,
// Feature toggles
enableSearch: false,
enableDateNav: false,
showUserStats: false,
enableCopyButton: false,
collapsibleEmbeds: false,
enableLightbox: false,
expandThreads: false,
includeJson: false,
messagesPerPage: undefined,
// Customization
customCss: undefined,
fontFamily: undefined,
pageTitle: undefined,
faviconUrl: undefined,
customRenderers: undefined,
});