> For the complete documentation index, see [llms.txt](https://docs.candy-smith.com/main/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.candy-smith.com/main/match-3-kit-home-design/services/leadboard-and-cloud-save-setup.md).

# Leadboard and cloud save setup

### 1. Link the Unity Project

1. Open the Unity Dashboard: [https://dashboard.unity3d.com](https://dashboard.unity3d.com/)
2. Select or create your project.
3. In Unity Editor, open: `Edit → Project Settings → Services`
4. Select `Use an existing Unity project ID`.
5. Choose your organization and Unity project.

### 2. Set Up Leaderboards

1. In the Unity Dashboard, open `Leaderboards`.
2. Create a leaderboard with these settings:
   * Leaderboard ID: `global_leaderboard`
   * Sort Order: `Descending`
   * Update Type: `Keep Best` or `Keep Latest`

The leaderboard ID must match the value in `LeaderboardSettings`.

### 3. Set Up Cloud Save

1. In the Unity Dashboard, open `Cloud Save`.
2. Click `Set up Cloud Save`.
3. Enable the service.

### 4. Set Up Cloud Code for Gifts

1. Go to  [https://cloud.unity.com/](https://cloud.unity.com/home/organizations/10170585042969/projects/65784a74-c686-4f46-aa4d-66dd84bde811/environments/58b5239f-77cc-4510-9733-5ceb27113279/cloud-code/scripts/SendGift) and open Cloud Code

2. Add  [SendGift.js](https://gist.github.com/dps999/6b1d5f611bc71a9183c79d8c5c43088d) to the cloud code

3. Add parameters:

   1. *receiverId* as string
   2. *senderId* as string
   3. *senderName* as string

4. Add [ClaimGift.js](https://gist.github.com/dps999/294df8763443601599ae1416a1533458) to the cloud code

5. Add parameters:
   1. giftId as string
