기술 자료

​
​

Development

User Acquisition

Monetization

산업 분야

Triggers

Triggers Admin API

Scheduler Admin API

Open Unity Dashboard

Triggers

이 페이지는 선택한 언어로 제공되지 않습니다.
LiveOps
​
​
Get started
  • Overview
  • Get started
  • Set up triggers example workflow
  • Authentication
Set up events
  • Understand and manage events
  • Schedule events
Define triggers
  • Define triggers
Configure actions
  • Use Cloud Code
  • Use webhooks
Manage and monitor
  • Use the dead letter queue (DLQ)
  • Limits
  • Failure handling
Examples and reference
  • Use case samples
    • Reward top players at end of season
    • Initialize newly signed-up players
    • Wish players a happy new year
    • Send a push message to player with beaten score
    • Announce a level up to all players in joined lobbies
    • Tune game difficulty level for individual players
    • Notify a Discord channel when players sign up
  1. Triggers
  2. Triggers use case samples

Use case sample: Notify a Discord channel when players sign up

Post messages to a Discord channel using a webhook trigger when players sign up with Authentication.
읽는 시간 4분
최근 업데이트: 5달 전

Many game teams use Discord for community and live ops. Discord incoming webhooks lets you post to a channel from an external URL. This sample shows how to use a Triggers webhook to post to Discord every time a player signs up so your team can monitor new sign-ups in real time.
For webhook configuration and template syntax, refer to Webhooks.

Prerequisites

  • A Discord server with a channel where you want messages to appear.
  • A Unity project with Triggers enabled. Refer to Get started if you haven't set up Triggers yet.
  • Familiarity with webhook actions. Refer to Webhooks.

Get a Discord webhook URL

Create an incoming webhook in your Discord server and note its URL structure.
  1. In Discord, open your server and the channel where you want messages (for example
    #new-players
    ).
  2. Open Channel settings > Integrations > Webhooks > New Webhook (or Create Webhook).
  3. Give the webhook a name (for example "player-signed-up"), then select Copy Webhook URL.
Discord webhook URLs have the following format:
https://discord.com/api/webhooks/{webhook.id}/{webhook.token}
Note the webhook ID (the numeric segment) and the webhook token (the string after it). Store both in Secret Manager.

Store the webhook credentials as secrets

Store the Discord webhook ID and token in Secret Manager so neither is exposed in the trigger configuration.
  1. In the Unity Dashboard, navigate to your project and environment.
  2. Open Secrets and select Add project secret.
  3. Enter the key
    DISCORD_WEBHOOK_ID
    and paste your numeric webhook ID as the value. Under Service Access, select Triggers. Select Add.
  4. Select Add secret again. Enter the key
    DISCORD_WEBHOOK_TOKEN
    and paste the token portion of the Discord webhook URL as the value. Under Service Access, select Triggers. Select Add.

Create the trigger in the Unity Dashboard

You can set up your webhook in the Unity Dashboard. Follow the steps below:
  1. In the Unity Dashboard, select Triggers (or Products > Triggers), select your environment, then select New trigger.
  2. Under When this happens, select signed-up (Authentication) as the trigger event.
  3. Under Do this, select Webhook as the action.
  4. In Callback URL, enter the Discord webhook URL with the ID and token as template expressions:
    https://discord.com/api/webhooks/{{ secret "DISCORD_WEBHOOK_ID" }}/{{ secret "DISCORD_WEBHOOK_TOKEN" }}
    The domain is fixed so the URL can be validated when you create the trigger. The Triggers service resolves both secrets from Secret Manager.
  5. For Method, select POST. For Content Type, select application/json.
  6. In the Environment Secret section, confirm that
    DISCORD_WEBHOOK_ID
    and
    DISCORD_WEBHOOK_TOKEN
    appear. If not, select + Add Environment Secret to create them here instead.
  7. In Payload, enter the Discord message body. For example:
    { "username": "player-signed-up", "content": "**New player signed up**\nPlayer ID: `{{.playerId}}` | Provider: `{{.providerId}}`"}
    The fields
    {{.playerId}}
    and
    {{.providerId}}
    come from the Signed up event payload. For richer messages, Discord also supports an
    embeds
    array. Refer to Discord's execute-webhook documentation for the full message format (
    content
    supports plain text and Markdown, up to 2000 characters).
  8. Select Confirm to create the trigger.

Verify the webhook

  1. Trigger a new player sign-up (for example from your game or via the Authentication sign-up API).
  2. Check your Discord channel. A message should appear with the new player's ID and provider.
팁
To trigger a sign-up without running your game, go to Cloud Code > Scripts in the Unity Dashboard, open any script, and then, on the Run Code tab, select Generate in the Player ID section. This creates a new anonymous player and triggers a signed-up event. For more information, refer to Generate a test Player ID.
If no message appears, open the trigger in the Unity Dashboard and select View Trigger Logs to check for delivery errors. If a delivery fails after retries, the event is added to the dead letter queue, where you can replay it.

Create the trigger via the API or CLI

To create the same trigger using the Triggers Admin API or the CLI, store
DISCORD_WEBHOOK_ID
and
DISCORD_WEBHOOK_TOKEN
in Secret Manager, then create the trigger:
{ "name": "discord-new-player", "eventType": "com.unity.services.player-auth.signed-up.v1", "actionType": "webhook", "actionUrn": "urn:ugs:webhook", "webhook": { "url": "https://discord.com/api/webhooks/{{ secret \"DISCORD_WEBHOOK_ID\" }}/{{ secret \"DISCORD_WEBHOOK_TOKEN\" }}", "method": "POST", "headers": { "Content-Type": "application/json" }, "payloadTemplate": "{\"username\": \"player-signed-up\", \"content\": \"**New player signed up**\\nPlayer ID: `{{.playerId}}` | Provider: `{{.providerId}}`\"}" }}

Additional resources

  • Webhooks
  • Dead letter queue
  • Define triggers in the Unity Dashboard
  • Secret Manager

Copyright © 2026 Unity Technologies
법률 정보개인정보 처리방침쿠키Documentation Terms of Use개인 정보 판매 또는 공유 금지개인정보 보호 선택(쿠키 설정)

'Unity', Unity 로고 및 기타 Unity 상표는 미국 및 기타 지역 내 Unity Technologies 또는 그 계열사의 상표 또는 등록상표입니다(자세한 내용은 여기에서 확인하세요). 기타 명칭 또는 브랜드는 해당 소유자의 상표입니다.

일부 페이지는 편의를 위해 기계 번역되었으며 부정확한 내용이 있을 수 있습니다. 정보가 상충되는 경우, 영어 버전을 우선으로 참조하세요.

  • 보고 있는 페이지
    • Prerequisites

    • Get a Discord webhook URL

    • Store the webhook credentials as secrets

    • Create the trigger in the Unity Dashboard

    • Verify the webhook

    • Create the trigger via the API or CLI

    • Additional resources


이 페이지의 문제 보고