# Backing up scripts

![](https://outline-production-attachments.s3-accelerate.amazonaws.com/uploads/fe746996-bd68-4ba8-a15e-e239ddd741be/cacbc9d0-6b3c-4a90-a987-b0b58baccc68/image.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA4EOUDTOVUICLPZ4P%2F20261103%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20261103T081500Z&X-Amz-Expires=86400&X-Amz-Signature=a3d27633fcbc3e4960c9b0883da21cd6527ce6ae97ba91bcaf8fe946ad3b44dc&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject " =1612x469")SmartBots Playground can keep a copy of the scripts you create in a private GitHub repository. Once it's set up, backups are automatic: you don't need to do anything when you save a script.

Backups are one-way. Playground copies your scripts to GitHub, but changes made on GitHub are not copied back to Playground.

## What you need

* A GitHub account. You can create one for free at [github.com](http://github.com).
* At least one script you created yourself. Scripts bought from the Bot Store are not backed up.
* Playground in **dev** mode. Use the **user / dev** switch at the top of the page.

## Set up backups


1. Open your Playground dashboard and find the **Script backups** card.
2. Click **Set up**.
3. Choose where your scripts go:
   * **New private repository**: Playground creates the repository on your GitHub account.
   * **Existing repository**: use a repository you already have. It must be private.
4. Click **Connect GitHub**. A GitHub window opens.
5. In the GitHub window, authorize **SmartBots Playground**. If GitHub asks, install the SmartBots Playground app and choose which repositories it can access. If you choose **Only select repositories**, include the repository you want to back up to.
6. The GitHub window closes and you return to Playground automatically.

Your first backup starts straight away and shows its progress.

 ![](https://outline-production-attachments.s3-accelerate.amazonaws.com/uploads/fe746996-bd68-4ba8-a15e-e239ddd741be/6803d16f-0794-425c-9d1d-470d02ed003a/image.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA4EOUDTOVUICLPZ4P%2F20261103%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20261103T081500Z&X-Amz-Expires=86400&X-Amz-Signature=b4b22b93ab40ece29fcca6475d5779e7c3833bb9a61f4edc756dcde3e51a7608&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject "left-50 =362x393")

## When backups happen

Playground backs up your scripts **5 minutes after your last change**. These all count as changes:

* saving a script
* renaming a script
* moving a script to another folder
* creating or deleting a script

Each change restarts the 5-minute wait. If you save several times in a row, you get one backup containing all your changes, 5 minutes after the last save. If you keep working without a 5-minute break, Playground still backs up at least once an hour.

## What's in your repository

Each script is saved as a JavaScript file in the `scripts` folder. Scripts in a Playground folder go in a subfolder with the same name:

* `scripts/Greeter [aY7kP2mQwX4rT9bLc].js`
* `scripts/Tools/Door opener [CbE5yKXQernrg8W8k].js`

 ![](https://outline-production-attachments.s3-accelerate.amazonaws.com/uploads/fe746996-bd68-4ba8-a15e-e239ddd741be/f586e422-bad8-4b81-8add-cfdb1c964e1f/image.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA4EOUDTOVUICLPZ4P%2F20261103%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20261103T081500Z&X-Amz-Expires=86400&X-Amz-Signature=0ad6e2381622445ac8c3d7c9b55a7d9c0e656ba5a3a4581a58aa3c757614539d&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject "left-50 =743x813")