Your first request, end to end.
Configure the Paggered deployment, configure TRENBot with the same secret, then enable the pilot only after the database projection and API deployment are ready.
Operator setup
Generate one pilot token
Generate at least 32 random bytes. Store the value in the deployment secret managers for Paggered and TRENBot. Never commit it, print it, or place it in a browser variable.
Generate locallyopenssl rand -base64 32Configure Paggered
The token authenticates TRENBot, not an athlete. Leave both features disabled until the migration and application deployment have succeeded, then configure the Discord OAuth application used to verify the administrator who connects a channel.
Paggered server environmentPAGGERED_API_ENABLED=false PAGGERED_CONNECTIONS_ENABLED=false PAGGERED_TRENBOT_TOKEN=<the-generated-token> PAGGERED_DISCORD_CLIENT_ID=<discord-application-id> PAGGERED_DISCORD_CLIENT_SECRET=<discord-oauth-secret> NEXT_PUBLIC_APP_URL=https://paggered.appIn the Discord Developer Portal, add this exact OAuth2 redirect URL. The connection requests only the identify scope and Paggered discards the access token after the identity check.
Discord OAuth2 redirecthttps://paggered.app/api/integrations/trenbot/discord/callbackConfigure TRENBot
Point both platform adapters at the Paggered deployment origin. The adapter refuses to start enabled when its URL or valid-length token is missing.
TRENBot service environmentPAGGERED_API_ENABLED=false PAGGERED_API_BASE_URL=https://paggered.app PAGGERED_API_TOKEN=<the-same-generated-token>Enable in order
Apply the reviewed SQL to staging, deploy Paggered and TRENBot disabled, enable the connection flow, connect one allowlisted Discord channel, make a direct request, then enable Discord. Roll back by disabling TRENBot first, then connection resolution and the Paggered API.
Make the request
curl --request GET \
--url https://paggered.app/api/v1/me \
--header "Authorization: Bearer $PAGGERED_API_TOKEN" \
--header "X-Paggered-Platform: discord" \
--header "X-Paggered-Platform-User-Id: $DISCORD_USER_ID" \
--header "X-Paggered-Guild-Id: $DISCORD_GUILD_ID" \
--header "X-Paggered-Channel-Id: $DISCORD_CHANNEL_ID" \
--header "Accept: application/json"{
"data": {
"display_name": "Connected athlete",
"unit_preference": "kg",
"timezone": "Europe/London"
},
"request_id": "0f693266-1957-4f47-9bd2-65718bed42f3"
}The example values are illustrative. The deployed response comes only from the active account connection for the supplied Discord channel.