> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-ko/rewards/integrations.md).

# 통합

Rewards 캠페인을 Decentraland 씬 또는 외부 서버에 연결하여 웨어러블과 이모트를 자동으로 지급합니다.

캠페인을 만들고 구성한 뒤 보상을 제공할 만큼 재고가 충분한지 확인했다면, 다음 단계는 캠페인을 보상 트리거와 연결하는 것입니다. 트리거는 Scene, Quest 또는 외부 서버일 수 있습니다. 이 섹션에서는 Rewards와 다양한 방식으로 연동하는 방법을 설명합니다.

## 씬에서 보상 지급하기

Rewards는 Decentraland 씬에 직접 통합할 수 있지만, 이 방식에는 몇 가지 위험이 따릅니다. 사용자가 접근할 수 있는 씬 코드에 로직이 포함되므로 희귀도가 \[EPIC]\([문서 보기](https://docs.decentraland.org/creator/content-creator-ko/readme.md)#rarity)보다 낮은 아이템을 민팅할 때는 이 방식을 권장하지 않습니다.

충분한 기술 지식을 갖춘 사용자는 캡차와 같은 보안 조치를 우회하거나 IP 주소를 변경하고, 사용 가능한 아이템을 모두 민팅할 수도 있습니다. 그런 다음 아이템을 마켓플레이스에서 판매할 수 있습니다. 이에 대한 주요 보호 조치는 아이템을 충분히 공급하여 모든 사용자가 공정하게 보상을 받을 기회를 갖도록 하는 것입니다.

### 권장 디스펜서 플래그

이 시나리오에서 악용 위험을 줄이려면 다음 디스펜서 구성을 권장합니다.

* \[할당 횟수 제한]\([문서 보기](https://docs.decentraland.org/creator/content-creator-ko/readme.md)#limit-assignments)
* \[수혜자 서명]\([문서 보기](https://docs.decentraland.org/creator/content-creator-ko/readme.md)#beneficiary-signature)
* \[캡차 보호]\([문서 보기](https://docs.decentraland.org/creator/content-creator-ko/readme.md)#captcha-protection)
* \[Decentraland 연결 여부]\([문서 보기](https://docs.decentraland.org/creator/content-creator-ko/readme.md)#connected-to-decentraland)
* \[Decentraland 내 위치]\([문서 보기](https://docs.decentraland.org/creator/content-creator-ko/readme.md)#position-inside-decentraland) (사용 사례에 해당하는 경우)

### 예제

```tsx
import { getPlayer } from '@dcl/sdk/src/players'
import { signedFetch } from '@decentraland/SignedFetch'
import { getRealm } from '~system/Runtime'

export function main() {
  // 1. 사용자에게 표시할 캡차 챌린지 가져오기
  const request = await fetch(`https://rewards.decentraland.org/api/captcha`, {
    method: 'POST',
  })
  const captcha = await request.json()

  // 2. 플레이어가 완료할 수 있도록 캡차 표시 - studios.decentraland.org/resources에서 예제 참조

  // 3. 사용자 데이터 가져오기
  const user = getPlayer()

  // 4. 현재 렐름 가져오기
  const realmInfo = await getRealm({})

  // 5. 웨어러블/이모트를 할당하는 요청 보내기
  const assignRequest = await signedFetch('https://rewards.decentraland.org/api/rewards', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      campaign_key: '[DISPENSER_KEY]', // 디스펜서 키
      beneficiary: user.userId, // 이더리움 주소
      catalyst: realmInfo.baseUrl, // 카탈리스트 도메인
      captcha_id: captcha.data.id, // "9e6b2d07-b47b-4204-ae87-9c4dea48f9b7"
      captcha_value: '[CAPTCHA_VALUE]', // "123456"
    }),
  })

  const reward = await assignRequest.json()
```

## Decentraland Quests에서 보상 지급하기

이 레거시 연동은 보관 처리된 Quests 문서로 연결됩니다.

Rewards는 다음과 쉽게 연동할 수 있습니다:  [Decentraland Quests](https://github.com/decentraland/documentation/blob/5f8c7f73c67a9a36e85095cb02e72dc6355fa590/content/creator/deprecated/quests/overview.md). 퀘스트를 완료한 사용자에게 보상을 제공하려는 경우 이 방법이 적합합니다.

### 권장 디스펜서 플래그

이 시나리오에서 악용 위험을 줄이려면 다음 디스펜서 구성을 권장합니다.

* \[할당 횟수 제한]\([문서 보기](https://docs.decentraland.org/creator/content-creator-ko/readme.md)#limit-assignments) (사용 사례에 해당하는 경우)

다른 플래그를 사용하면 통합이 실패할 수 있으므로 사용하지 마세요.

{% hint style="warning" %}
⚠️ 디스펜서 키는 비밀로 유지해야 하므로 어떤 경우에도 사용자에게 노출해서는 안 됩니다.
{% endhint %}

### 예제

퀘스트를 Rewards 서비스와 통합하려면 디스펜서 키를 준비하고 [웹훅을 구성](https://github.com/decentraland/documentation/blob/5f8c7f73c67a9a36e85095cb02e72dc6355fa590/content/creator/deprecated/quests/rewards.md) 하면 보상을 지급할 수 있습니다.

```js
{
    // ...
    "reward": {
        "hook": {
            "webhookUrl": "https://rewars.decentraland.org/api/rewards",
            "requestBody": {
                "campaign_key": "[DISPENSER_KEY]",
                "beneficiary": "{user_address}"
            }
        },
        // ...
    }
}
```

## 맞춤 서버에서 보상 지급하기

서버에서 직접 Rewards를 통합할 수 있습니다. 이는 아이템을 발행하기 전에 추가 검사를 수행하는 데 적합합니다. 또 다른 이점은 씬 코드와 달리 서버 코드가 공개되지 않을 수 있어 사용자가 취약점을 찾아 악용하기가 더 어렵다는 것입니다.

### 권장 디스펜서 플래그

이 시나리오에서 악용 위험을 줄이려면 다음 디스펜서 구성을 권장합니다.

* \[할당 횟수 제한]\([문서 보기](https://docs.decentraland.org/creator/content-creator-ko/readme.md)#limit-assignments) (사용 사례에 해당하는 경우)

다른 플래그를 활성화하면 통합이 복잡해지거나 사용 사례에 따라 통합이 실패할 수 있습니다. 따라서 특별한 이유가 없다면 사용하지 않는 것이 좋습니다. 다만, 해당 플래그가 제공할 수 있는 이점을 살펴보는 것도 좋습니다.

{% hint style="warning" %}
⚠️ 디스펜서 키는 비밀로 유지해야 하므로 어떤 경우에도 사용자에게 노출해서는 안 됩니다.
{% endhint %}

### 예제

```tsx
const request = await fetch('https://rewards.decentraland.org/api/rewards', {
	method: 'POST',
	headers: {
		'Content-Type': 'application/json',
	},
	body: JSON.stringify({
		campaign_key: '[DISPENSER_KEY]',
		beneficiary: '0x0f5d2fb29fb7d3cfee444a200298f468908cc942', // ethereum address
	}),
})

const response = await request.json()
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/creator/content-creator-ko/rewards/integrations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
