@altkit/discord v4.1.0
This release improves Discord API v10 compatibility across REST, Gateway, attachments, modal components, invites, and
application payloads. It also introduces consistent TLS configuration and secure transport defaults for REST, Gateway,
voice, and remote-auth connections.
Altkit Discord remains user-account-only and continues to target the Discord.js 14.27.0 API surface where it applies to
this fork.
Highlights
- Added secure TLS 1.2-or-newer defaults across supported network transports.
- Added separate REST, Gateway/voice, destination-proxy, and HTTPS-proxy TLS configuration.
- Updated REST rate-limit handling to use Discord bucket hashes, methods, major resources, and current rate-limit scopes.
- Avoids automatically replaying ambiguous non-idempotent requests.
- Added current voice-channel information, community invite, attachment spoiler, and modal-component support.
- Preserves full
flags_newapplication bitfields asbigint. - Expanded the migration guide, client configuration, feature guides, API reference, and README.
TLS and transport security
REST, Gateway, voice, and remote-auth connections now use a minimum of TLS 1.2 by default while retaining the library's
browser-like cipher ordering and Node.js certificate verification.
Custom destination TLS settings can be configured independently:
const client = new Client({
http: {
tls: { ca: process.env.REST_CA_CERT },
},
ws: {
tls: { ca: process.env.GATEWAY_CA_CERT },
},
});For REST proxies:
http.tlsconfigures the connection to Discord and takes precedence over matchingrequestTlsfields.http.agent.requestTlsconfigures the proxy-to-Discord destination connection.http.agent.proxyTlsconfigures the connection to an HTTPS proxy itself.- Existing concrete HTTPS proxy agents remain supported.
- Legacy plain-object WebSocket agent options remain compatible, although
ws.tlsis preferred.
Do not set rejectUnauthorized: false in production. Disabling certificate verification can expose account credentials and
Discord traffic to interception.
REST and rate limits
- Discovers and caches Discord's
X-RateLimit-Buckethashes. - Separates handlers by HTTP method, normalized route, and major channel, guild, or webhook resource.
- Isolates webhook IDs and tokens for rate limiting while redacting tokens from public route diagnostics.
- Honors global, user, shared, and route-specific rate-limit signals.
- Accepts retry timing from either
Retry-Afteror the JSONretry_afterresponse field. - Excludes shared-scope 429 responses from the invalid-request warning counter.
- Preserves the original transport error as
HTTPError#cause. - Successful
204and205responses now resolve toundefined.
Automatic retries are now limited to idempotent methods such as GET, HEAD, OPTIONS, PUT, and DELETE. Ambiguous
POST and PATCH transport failures or server errors are returned without replay because Discord may already have applied
the request. Internal callers can explicitly opt in only when an operation is known to be safe to retry.
Discord API and Gateway v10
Voice channel information
- Added Gateway opcode 43 (
REQUEST_CHANNEL_INFO). - Added
Guild#requestChannelInfo()for thestatusandvoice_start_timefields. - Added
CHANNEL_INFOandVOICE_CHANNEL_START_TIME_UPDATEhandlers. - Voice channel status and start-time updates refresh the cached channel and emit
channelUpdate. - Added
BaseGuildVoiceChannel#voiceStartTimestampandvoiceStartAt.
Community invites
- Invite creation accepts
roleIdsfor roles assigned when an invite is accepted. - Invite creation accepts
targetUsersFileas a CSV file or an array of user resolvables. - Added
GuildInviteManager#fetchTargetUsers(). - Added
GuildInviteManager#updateTargetUsers(). - Added
GuildInviteManager#fetchTargetUsersJobStatus(). - Added partial invite roles through
Invite#roles. - Target-user CSV arrays use Discord's standardized
user_idheader.
Messages and attachments
- New uploads and message edits send explicit
is_spoilerattachment metadata. AttachmentBuilder#setSpoiler()continues to maintain the legacySPOILER_filename prefix for compatibility.- Existing attachments retain their spoiler state when message payloads are rebuilt.
- Forum-thread starter messages include spoiler metadata for uploaded files.
Applications and components
- Added
Application#flagsNewas abigintso application flag bits above bit 30 retain full precision. - Added current Label, File Upload, Radio Group, Checkbox Group, and Checkbox component values and serialization shapes.
- Added the corresponding component enums, raw data types, runtime exports, and TypeScript declarations.
Images and CDN validation
- Image buffers now produce matching JPEG, PNG, or GIF data-URI MIME types.
- Unknown image signatures throw instead of being incorrectly labeled as JPEG.
- CDN image sizes now accept only documented powers of two from 16 through 4096.
Compatibility and upgrade notes
- Node.js
20.19.0or newer remains required. - Discord.js compatibility remains at
14.27.0. - Bot tokens and bot-owned command, interaction-response, intent, and sharding workflows remain unsupported.
GuildManager#create()remains only as a deprecated, undocumented user-account compatibility helper.- Applications that relied on automatic
POSTorPATCHreplay should add their own operation-specific recovery logic. - Applications that expected an empty
ArrayBufferfrom204or205responses should now handleundefined. - Custom certificate settings should move to
http.tls,ws.tls,requestTls, orproxyTlsaccording to their target. - Previously accepted non-power-of-two CDN sizes such as
56,96,300, and600must be changed.
Dependencies updated in this release include:
undicifrom^6.27.0to^7.28.0.globalsfrom^16.3.0to^17.7.0.
Review the included migration guide for detailed examples and TLS precedence rules before deploying the upgrade.
Documentation and testing
- Reworked the README for the current v4 user-account-only and API v10 scope.
- Expanded the Altkit migration guide with API v10, TLS, proxy, retry, attachment, voice, invite, and application changes.
- Added dedicated client configuration, security, voice-channel information, and community invite documentation.
- Made the documentation navigation version derive from
package.json. - Regenerated the API reference with the new structures, methods, properties, and typings.
- Added API v10 and TLS regression suites.
- Passed linting, formatting, documentation parsing, TypeScript and
tsd, example checks, 48 unit tests, package smoke
testing, and the VitePress production build.
Installation
npm install @altkit/discord@4.1.0Warning
Automating normal Discord user accounts may violate Discord's Terms of Service and can result in account restrictions or
termination. Altkit Discord is unofficial, is not supported by Discord, and is used at your own risk.
Full changelog: v4.0.4...v4.1.0