> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CloudScript quickstart

> Upload, revise, and invoke PlayFab CloudScript JavaScript files from Game Manager, then call them from your Unity game client or PlayStream actions.

CloudScript offers a fast, secure and scalable alternative to dedicated servers. Your custom JavaScript lives and executes directly on PlayFab machines.

<Note>
  [CloudScript using Azure Functions](/services/playfab/live-service-management/service-gateway/automation/cloudscript-af/quickstart) supports more languages and has improved debugging workflows.
</Note>

From here, your code can be called *directly* by your game clients - or indirectly via PlayStream actions. Additionally, CloudScript methods have full access to PlayFab's [Server](/services/playfab/api-references) API set.

This quickstart covers uploading and managing your CloudScript files in the PlayFab Game Manager.

<Note>
  The [Writing custom CloudScript](/services/playfab/live-service-management/service-gateway/automation/cloudscript/writing-custom-cloudscript) tutorial covers writing the CloudScript code itself.
</Note>

Please note the following when reading this:

* You should be familiar with the basics of PlayFab.
* The **C#** samples shown correspond to using the PlayFab Unity SDK.
* JavaScript samples correspond to using the PlayFab CloudScript service.

## Your first CloudScript revision

After creating a title, PlayFab automatically includes an example script as your first revision. This revision includes a number of methods that you can use for learning and testing CloudScript.

To see these functions:

* Open [Game Manager](https://developer.playfab.com/).
* Select your title.
* Select **Automation** on the left side bar.

You should see a number of CloudScript methods - such as **HelloWorld**, which logs the message **Hello PLAYERID** - where **PLAYERID** is the current player's PlayFab ID.

<img src="https://mintcdn.com/microsoft-4404708b/dqv53299jA1M-fNi/images/playfab/live-service-management/service-gateway/automation/cloudscript/tutorials/game-manager-cloudscript.png?fit=max&auto=format&n=dqv53299jA1M-fNi&q=85&s=c97908f94559bbfd9d2b48d955d581a2" alt="Game Manager - Automation - CloudScript" width="1366" height="900" data-path="images/playfab/live-service-management/service-gateway/automation/cloudscript/tutorials/game-manager-cloudscript.png" />

## Uploading your own revisions

You can upload your own custom methods via the Game Manager. Each file you upload will create a new revision. During the upload, the PlayFab service runs a simple LINT check over your CloudScript for syntax errors.

If it finds an error:

* An error message will be displayed.
* Fix the error, and select **SUBMIT** again.
* By default, new uploads must be deployed by selecting the **DEPLOY REVISION # TO LIVE** link. This enables you to update or roll back to/from multiple versions of CloudScript.

The first time you press the orange **UPLOAD NEW REVISION** button, you will see a file selector where you can upload a file from your local machine.

<img src="https://mintcdn.com/microsoft-4404708b/dqv53299jA1M-fNi/images/playfab/live-service-management/service-gateway/automation/cloudscript/tutorials/game-manager-upload-cloudscript.png?fit=max&auto=format&n=dqv53299jA1M-fNi&q=85&s=68f6073c262ee7022e2d177b9ef0b0d8" alt="Game Manager - Upload CloudScript file" width="392" height="250" data-path="images/playfab/live-service-management/service-gateway/automation/cloudscript/tutorials/game-manager-upload-cloudscript.png" />

After you have added several revisions, you can select *which* submitted revision is live with the drop-down.

<img src="https://mintcdn.com/microsoft-4404708b/dqv53299jA1M-fNi/images/playfab/live-service-management/service-gateway/automation/cloudscript/tutorials/game-manager-cloudscript-select-revision.png?fit=max&auto=format&n=dqv53299jA1M-fNi&q=85&s=cd0cb0ba3694a687309320bb0dd9b208" alt="Game Manager - Upload CloudScript - select revision" width="1366" height="771" data-path="images/playfab/live-service-management/service-gateway/automation/cloudscript/tutorials/game-manager-cloudscript-select-revision.png" />

## GitHub integration

You may also use GitHub to manage your CloudScript revisions. You must have a GitHub account, and you must be logged in.

* Select the **USE GITHUB** button (the gray button in the previous screenshot).
* The next window will have an orange **AUTHORIZE GITHUB ACCOUNT** button.
* Create a new, empty repository in **GitHub**.
* Return to the **GitHub** page in the PlayFab Game Manager (refresh tab).
* At this point, you should be able to select your **GitHub** repository, and bind it to your title.

<img src="https://mintcdn.com/microsoft-4404708b/dqv53299jA1M-fNi/images/playfab/live-service-management/service-gateway/automation/cloudscript/tutorials/game-manager-addons-github.png?fit=max&auto=format&n=dqv53299jA1M-fNi&q=85&s=dbc72c3437b55c738803cf6cb013ae90" alt="Game Manager - Addons - GitHub" width="1366" height="909" data-path="images/playfab/live-service-management/service-gateway/automation/cloudscript/tutorials/game-manager-addons-github.png" />

Once bound to GitHub, the manual upload option is removed, and new CloudScript revisions are automatically made for each GitHub commit to the "master" branch.

If you commit *multiple* files, they will be concatenated together into a single PlayFab CloudScript revision. Live revision selection remains the same: new commits to GitHub must be set to live in Game Manager as described above.

## Conclusion

CloudScript allows you to upload files to PlayFab, and execute your code on our server. You can manage your CloudScript files from the **Automation** option in the left side bar. You can upload files manually from your own computer, or bind your title to a GitHub account.

This quickstart covers managing your code files and uploading them to PlayFab.

If you have more questions, the [Writing custom CloudScript tutorial](/services/playfab/live-service-management/service-gateway/automation/cloudscript/writing-custom-cloudscript) explains more about how to write your CloudScript code files.


## Related topics

- [Scheduled tasks quickstart](/services/playfab/data-analytics/acting-data/scheduled-tasks/quickstart.md)
- [Writing custom CloudScript](/services/playfab/live-service-management/service-gateway/automation/cloudscript/writing-custom-cloudscript.md)
- [Modify read-only or internal player data via CloudScript](/services/playfab/player-progression/player-data/how-to-modify-read-only-internal-player-data.md)
- [Quickstart Player Data](/services/playfab/player-progression/player-data/quickstart.md)
- [Title Data quickstart](/services/playfab/live-service-management/game-configuration/titledata/quickstart.md)
