> 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]\([문서 보기](/creator/content-creator-ko/readme.md)#rarity).

충분한 기술 지식을 가진 의도적인 사용자는 캡차와 같은 보안 조치를 우회하고 IP 주소를 변경한 뒤, 사용 가능한 모든 아이템을 민팅할 수도 있습니다. 이후 이를 마켓플레이스에서 판매할 수 있습니다. 이를 막는 가장 중요한 보호책은 모든 사람이 보상을 받을 공정한 기회를 가질 수 있도록 충분한 수량의 아이템을 확보하는 것입니다.

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

다음 디스펜서 구성은 이 시나리오에서 악용 위험을 줄이기 위해 권장됩니다:

* \[할당 제한]\([문서 보기](/creator/content-creator-ko/readme.md)#limit-assignments)
* \[수혜자 서명]\([문서 보기](/creator/content-creator-ko/readme.md)#beneficiary-signature)
* \[캡차 보호]\([문서 보기](/creator/content-creator-ko/readme.md)#captcha-protection)
* \[Decentraland에 연결됨]\([문서 보기](/creator/content-creator-ko/readme.md)#connected-to-decentraland)
* \[Decentraland 내 위치]\([문서 보기](/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. 현재 realm 가져오기
  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, // Catalyst 도메인
      captcha_id: captcha.data.id, // "9e6b2d07-b47b-4204-ae87-9c4dea48f9b7"
      captcha_value: '[CAPTCHA_VALUE]', // "123456"
    }),
  })

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

## Decentraland 퀘스트에서 보상 지급

Rewards를 다음과 쉽게 통합할 수 있습니다: [Decentraland 퀘스트](https://github.com/decentraland/docs/tree/main/creator/deprecated/quests/overview.md), 이는 퀘스트를 완료한 사용자에게 보상을 주고 싶을 때 이상적입니다.

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

다음 디스펜서 구성은 이 시나리오에서 악용 위험을 줄이기 위해 권장됩니다:

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

그 외의 다른 플래그를 사용하면 통합이 실패하므로 사용하지 마세요.

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

### 예시

Quest를 Rewards 서비스와 통합하려면 디스펜서 키와 [웹훅을 구성하기만 하면 됩니다](https://github.com/decentraland/docs/tree/main/creator/deprecated/quests/rewards.md) 보상을 지급할 수 있습니다.

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

## 사용자 정의 서버에서 보상 지급

서버에서 직접 Rewards를 통합할 수 있으며, 이는 아이템을 민팅하기 전에 추가 검사를 수행하는 데 이상적입니다. 추가적인 장점은 씬 코드와 달리 서버 코드가 공개되지 않을 수 있어, 사용자가 취약점을 발견하고 악용하기가 더 어려워진다는 점입니다.

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

다음 디스펜서 구성은 이 시나리오에서 악용 위험을 줄이기 위해 권장됩니다:

* \[할당 제한]\([문서 보기](/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', // 이더리움 주소
	}),
})

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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
