Overview
Stars Components is a set of focused TypeScript packages powering the Star Network. The core of it is@wolfstar/http-framework: an HTTP-first framework for Discord applications that answers
interactions over a webhook endpoint instead of holding a gateway connection open.
Around it sit optional packages for internationalization, environment parsing, logging, metrics, platform helpers, and
interaction testing. Adopt one of them on its own, or combine them into a complete bot stack — see
Features for the full picture and Why Stars Components for the reasoning behind it.
Adding Stars Components to Your Project
The fastest way to start is the@wolfstar/create-http-framework CLI. It creates the entry point, an example command,
environment files, TypeScript or JavaScript configuration, and your preferred quality tools.
- TypeScript or JavaScript
tsdown, TypeScript 6, or the TypeScript 7 release candidate for TypeScript builds- Oxlint, ESLint, or no linter
- Oxfmt, Prettier, or no formatter
- Optional i18n support
- HTTP port and package manager
Configuring Credentials
Open the generated.env file and provide the credentials from the Discord developer portal:
Never commit this file or expose either value in logs.
Writing Your First Command
The generated entry point creates a client, loads commands fromsrc/commands, and starts the HTTP server:
Configuring the Client
client.load() accepts no arguments above: it reads your package.json’s main field (dist/index.js in the
generated project) and looks for a commands directory next to it, so there’s no manual path resolution to write —
as long as you run the app from the project root (as pnpm start/node . does) and main points at the file you
actually run. discordToken and discordPublicKey are picked up from the DISCORD_TOKEN and DISCORD_PUBLIC_KEY
environment variables the same way, so you don’t need to pass them to new Client() either.
This is the same pattern used in production bots such as
wolfstar-project/staryl and
wolfstar-project/ring, whose package.json
files set main to their built entry point the same way:
main — no package.json (e.g. tests), a different working directory, or commands that don’t
live in a commands directory next to the entry point — pass baseUserDirectory explicitly. It’s the root
directory — client.load() appends the store name (commands, interaction-handlers, …) to it for you, so
don’t include commands in the path yourself. For example, if your build puts everything under a bot/
subdirectory next to the entry file (bot/commands, bot/interaction-handlers, …):
Examples
Next Steps
- Follow Build a Command to understand decorators and interactions.
- Configure your public URL as the Discord application’s interactions endpoint.
- Add interaction tests before expanding the command set.
- Browse the
@wolfstar/http-frameworkpackage guide and API reference.