PAGGEREDTRENBot · read-only

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

  1. 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 locally
    openssl rand -base64 32
  2. Configure 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 environment
    PAGGERED_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.app

    In 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 redirect
    https://paggered.app/api/integrations/trenbot/discord/callback
  3. Configure 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 environment
    PAGGERED_API_ENABLED=false
    PAGGERED_API_BASE_URL=https://paggered.app
    PAGGERED_API_TOKEN=<the-same-generated-token>
  4. 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

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"
200 response
{
  "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.