# discord\.js

[BASE product page](<https://base.akulich.dev/en/library/discord-js/>) · [Resource](<https://github.com/discordjs/discord.js>)

ID: discord\-js · Language: en
Schema version: 1 · Data version: cbbe7123b47a5ae80983

This is editorial data. An unknown field neither confirms nor rules out a capability.
dataVersion is a dataset fingerprint, not evidence of a recent fact check.

A Node\.js Discord API and Gateway library: it helps create bots, commands, and server event integrations\.

## Type

Backend / API library

## Entry type

library

## Separate catalog

No

## [Access conditions](<https://base.akulich.dev/en/library/discord-js/#resource-access>)

free

## [What you can use for free](<https://base.akulich.dev/en/library/discord-js/#resource-access>)

Code and local use under Apache\-2\.0\.

## [Paid features and costs](<https://base.akulich.dev/en/library/discord-js/#resource-access>)

Computing resources, self\-hosting, and external services are paid for separately if used\.

## [Access and limitations](<https://base.akulich.dev/en/library/discord-js/#resource-access>)

Code and local use under Apache\-2\.0\. Computing resources, self\-hosting, and external services are paid for separately if used\.

## [Use cases](<https://base.akulich.dev/en/library/discord-js/#resource-tasks>)

- Create a Discord bot with commands and events
- Connect handlers to the Discord API and test a command in a test environment

## Category IDs

- backend

## Subcategory IDs

- backend\.api

## Tags

- discord\.js
- API
- Development

## Also known as

- discordjs/discord\.js
- discord\-js
- discordjs\-library

## [Selection purpose](<https://base.akulich.dev/en/library/discord-js/#resource-selection>)

Create a Discord bot with commands and events

## [Choose this when](<https://base.akulich.dev/en/library/discord-js/#resource-selection>)

- Create a Discord bot with commands and events
- Connect handlers to the Discord API and test a command in a test environment

## [Requirements](<https://base.akulich.dev/en/library/discord-js/#resource-selection>)

- The current main package README requires Node\.js 24\.17\.0 or later; check the chosen release's requirement\.

## [Limitations](<https://base.akulich.dev/en/library/discord-js/#resource-selection>)

- Costs and limits of free use: Computing resources, self\-hosting, and external services are paid for separately if used\.
- Terms of use: Apache\-2\.0 for the code; third\-party components retain their own terms\.

## [Questions before use](<https://base.akulich.dev/en/library/discord-js/#resource-faq>)

### What can you use for free in discord\.js?

Code and local use under Apache\-2\.0\.

### What additional costs might arise with discord\.js?

Computing resources, self\-hosting, and external services are paid for separately if used\.

### What terms of use matter for discord\.js?

Apache\-2\.0 for the code; third\-party components retain their own terms\.

### How do you get started with discord\.js?

Define commands, Gateway events, and required bot application permissions\. Connect handlers to the Discord API and test a command in a test environment\. Add error handling and an integration check of the result\.

### What is needed for a simple slash\-command bot?

The README separately demonstrates REST/Routes command registration and a Client InteractionCreate handler with Gateway intents\. The voice API uses additional @discordjs/voice; zlib\-sync and bufferutil are optional optimizations\.

## Sources for the selection guide

- [https://github\.com/discordjs/discord\.js](<https://github.com/discordjs/discord.js>)
- [https://raw\.githubusercontent\.com/discordjs/discord\.js/HEAD/README\.md](<https://raw.githubusercontent.com/discordjs/discord.js/HEAD/README.md>)
- [https://raw\.githubusercontent\.com/discordjs/discord\.js/HEAD/LICENSE](<https://raw.githubusercontent.com/discordjs/discord.js/HEAD/LICENSE>)
- [https://www\.open\-source\-tools\.com/](<https://www.open-source-tools.com/>)
- [https://raw\.githubusercontent\.com/discordjs/discord\.js/HEAD/packages/discord\.js/README\.md](<https://raw.githubusercontent.com/discordjs/discord.js/HEAD/packages/discord.js/README.md>)

## [Possible workflow](<https://base.akulich.dev/en/library/discord-js/#resource-scenario>)

Create a Discord bot with commands and events\.

A possible workflow; this is not a report of hands-on testing.

## Before you start

- A data contract or HTTP workflow\.
- A project with a supported runtime\.

## Steps

1. Define commands, Gateway events, and required bot application permissions\.
2. Connect handlers to the Discord API and test a command in a test environment\.
3. Add error handling and an integration check of the result\.

## Check your result

- Invalid and missing data are handled predictably\.
- Types and the actual response agree; errors are not hidden\.

## [License](<https://base.akulich.dev/en/library/discord-js/#resource-license>)

Apache\-2\.0 for the code; third\-party components retain their own terms\.

## License explanations for the specified scope

### Apache 2\.0 — permissive license with patent terms

You can use and modify the code in commercial and closed\-source projects\. When distributing it, retain the license and relevant notices, identify modified files, and include NOTICE if provided\. Authors grant a limited patent license for their contributions; it does not grant permission to use trademarks\.

[License terms](<https://www.apache.org/licenses/LICENSE-2.0>)

## [Sources](<https://base.akulich.dev/en/library/discord-js/#resource-sources>)

- [Official source](<https://github.com/discordjs/discord.js>)
- [Official source](<https://raw.githubusercontent.com/discordjs/discord.js/HEAD/README.md>)
- [License](<https://raw.githubusercontent.com/discordjs/discord.js/HEAD/LICENSE>)
- [Catalog / discovery source](<https://www.open-source-tools.com/>)
- [Official source](<https://raw.githubusercontent.com/discordjs/discord.js/HEAD/packages/discord.js/README.md>)

## Editorial review date

2026\-10\-06

## Editorial review scope

The purpose, current repository license, and separate terms for code, services, and models have been reviewed\. The product was not run, and no security audit was performed\.

Dates refer to the stated editorial review, not hands-on testing, a product update, or a recent review of all sources.
