Skip to main content

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().

OptionTypeDefaultDescription
limitnumber100Number of messages to fetch (max: 5000)
beforestring-Fetch messages before this message ID
afterstring-Fetch messages after this message ID
filenamestringautoCustom filename for the output
returnBufferboolean-Return as Buffer
resolveRolesbooleantrueResolve member roles for colored usernames

Display Options

OptionTypeDefaultDescription
theme"dark" | "light""dark"Color theme
compactbooleanfalseCompact message layout
dateFormat"relative" | "absolute" | "both""absolute"Timestamp format
maxImageWidthnumber400Maximum image width in pixels
showReactionsbooleantrueShow message reactions
showAvatarsbooleantrueShow user avatars
showTimestampsbooleantrueShow message timestamps
showRoleColorsbooleantrueColor usernames by role
showEmbedsbooleantrueRender embeds
showAttachmentsbooleantrueRender attachments
showThreadsbooleantrueShow thread indicators
showHeaderbooleantrueShow channel header

Feature Toggles

All of these are off by default. Turn on the ones you want.

OptionTypeDefaultDescription
enableSearchbooleanfalseAdd message search bar
enableDateNavbooleanfalseAdd jump-to-date navigation
showUserStatsbooleanfalseShow user statistics section
enableCopyButtonbooleanfalseShow copy button on hover
collapsibleEmbedsbooleanfalseMake embeds collapsible
enableLightboxbooleanfalseClick images to view full-size
expandThreadsbooleanfalseShow expandable thread messages
includeJsonbooleanfalseEmbed raw JSON data in output
messagesPerPagenumber-Enable pagination (messages per page)

Customization

OptionTypeDefaultDescription
customCssstring-Additional CSS to inject
fontFamilystring-Override font family
pageTitlestringautoCustom page <title>
faviconUrlstring-Custom favicon URL
customRenderersRecord<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,
});