Support & Integration Endpoints
These endpoints provide integration with external services for monetization and user authentication. They are only available whenUSE_BACKEND=true is configured.
GET /getSupportPackages
Fetches available support packages from the Tebex platform. Results are cached for 10 minutes to reduce API calls.Configuration Required
Must be set to
"true"Base URL for the Tebex API
Your Tebex store identifier
Tebex extension identifier for the integration
Response
Array of package objects from Tebex
Example Request
Example Response
Error Responses
Failed to fetch packages from Tebex API
Server error during package fetch
Caching Behavior
- Packages are cached for 10 minutes after first fetch
- Subsequent requests within 10 minutes return cached data
- Cache automatically clears after timeout
The
checkoutUrl field is dynamically generated by the server using the configured Tebex base URL, store ID, package ID, and extension ID.GET /client/oauth-callback
Handles the OAuth callback from Discord authentication. This endpoint receives the authorization code, exchanges it for an access token, fetches user information, and redirects to the Spectra Client via deeplink.Configuration Required
Must be set to
"true"Discord application client ID
Discord application client secret
OAuth redirect URI (must match Discord app configuration)
Discord OAuth token endpoint URL
Discord user information endpoint URL
Deeplink protocol URL for launching the Spectra Client
Query Parameters
Authorization code from Discord OAuth flow
Response
Returns an HTML page that:- Displays a success message with the user’s Discord username
- Automatically redirects to the Spectra Client after 2 seconds
- Provides a manual button to open the client if auto-redirect fails
userId- Discord user IDusername- Discord usernameavatar- Discord avatar hash
Example Deeplink
HTML Response
The endpoint returns a styled HTML page with:- Success message with user’s display name
- Auto-redirect script (2 second delay)
- Manual “Open Spectra Client” button
- Gradient background styling
Error Responses
Failed to fetch Discord user data
Error during OAuth flow
OAuth Flow
This endpoint is designed specifically for the Spectra Client’s Discord integration. The deeplink protocol must be registered with the operating system to launch the client application.
Implementation Reference
Both endpoints are implemented insrc/util/SupportService.ts and conditionally registered in src/index.ts:
Related Documentation
Configuration Guide
Configure Tebex and Discord environment variables
Integrations
Learn about backend integration setup
REST API Overview
View all available REST endpoints