A comprehensive cloud backup and sync extension for TypingMind that automatically backs up and synchronizes your entire TypingMind data with AWS S3 or S3-compatible cloud storage services.
⚠️ Important: Before installing, it’s always a good practice to export your TypingMind data via “Settings > App Data & Storage > Export” as a local backup.
https://itcon-pty-au.github.io/typingmind-cloud-backup/s3-v3.js
After installation, you’ll see a new Sync button in the sidebar. Click it to open the configuration modal.
First Time Setup: If you haven’t configured the mandatory fields (bucket name, region, access key, secret key, encryption key), the extension will show an alert prompting you to configure these settings. The extension needs these credentials to function.
Required Fields (marked with *):
us-east-1
; use auto
for Cloudflare R2).Optional Fields:
Exclusions - Comma-separated list of additional keys to exclude from sync.
Note: System keys (starting with
tcs_
) and sensitive keys are automatically excluded.
Add parameters to your TypingMind URL for automatic setup. This is useful for quickly configuring a new browser or device.
https://your-typingmind-url.com/?bucket=your-bucket®ion=us-east-1&accesskey=your-key&secretkey=your-secret&encryptionkey=your-password&config
Available URL Parameters:
bucket
- S3 bucket nameregion
- AWS regionaccesskey
- Access key IDsecretkey
- Secret access keyendpoint
- S3 endpoint (for compatible services)encryptionkey
- Encryption passwordsyncinterval
- Sync interval in secondsexclusions
- Comma-separated exclusion listconfig
or autoconfig
- Auto-open the config modal on load.log
- Enable console logging from startup.nosync
- Enable NoSync mode (snapshots only).Add ?nosync
to your URL to enable this mode.
The sync modal is your central hub for managing backups and settings.
The Available Backups section shows all your cloud backups.
Backup Types:
s-
prefix) - Manually created, named backups of your data at a specific point in time.typingmind-backup-
prefix) - Automatic daily backups.Actions:
This panel provides a quick overview of your sync status. It helps identify discrepancies between your local data and cloud data.
Ideally, all counts should match after a successful sync.
The sync button in the sidebar shows a colored dot indicating the current status. The dot is only visible when the extension is configured and has performed a sync operation.
V3 is a major rewrite and is not backward compatible with backups created by older versions (V1 or V2).
When you load the V3 extension for the first time, the process is largely automatic:
There is no manual data migration required—the extension handles everything automatically on the first load. Just install, configure, and let it work.
https://itcon-pty-au.github.io/typingmind-cloud-backup/s3-v3.js
.To help you safely clean up old files from previous versions, here is a breakdown of the file structure used by V3 in your S3 bucket. Any files or folders not matching this structure are likely from an older version and can be removed.
metadata.json
: This is the most critical file for synchronization. It acts as the central index for all your data, tracking every item’s sync status, version, and deletions (tombstones). It resides at the root of your bucket./items
: This directory contains the actual encrypted data for every individual item in your TypingMind application (chats, settings, etc.). Each item is stored as a separate file within this folder./backups
: This directory holds all your on-demand snapshots and automatic daily backups.
backups/s-my-snapshot-20231027T120000/
or backups/typingmind-backup-20231027/
).metadata.json
and an items/
directory, representing the state of your data at the time of the backup.Any other files or folders at the root of your bucket, are no longer used by V3 and can be safely deleted once you have successfully migrated. This is how your S3 bucket should look like.
YOUR_BUCKET_NAME
with your actual bucket name and YOUR_USER_ARN
with the ARN of the user you created.{
"Version": "2012-10-17",
"Statement":
[
{
"Effect": "Allow",
"Principal":
{ "AWS": "arn:aws:iam::<AWS Account ID>:user/<IAM username>" },
"Action":
[
"s3:ListBucket",
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject",
"s3:ListBucketMultipartUploads",
"s3:ListMultipartUploadParts",
"s3:AbortMultipartUpload",
"s3:GetBucketLocation",
"s3:GetBucketVersioning",
"s3:ListBucketVersions",
"s3:DeleteObjectVersion",
],
"Resource":
[
"arn:aws:s3:::<AWS bucket name>",
"arn:aws:s3:::<AWS bucket name>/*",
],
},
{
"Sid": "PreventSpecificFileDeletion",
"Effect": "Deny",
"Principal":
{ "AWS": "arn:aws:iam::<AWS Account ID>:user/<IAM username>" },
"Action": "s3:DeleteObject",
"Resource": "arn:aws:s3:::<AWS bucket name>/typingmind-backup.json",
},
],
}
Update AWS Account ID, IAM username and AWS bucket name in the policy with your specific values.
[
{
"AllowedHeaders": ["*"],
"AllowedMethods": ["HEAD", "GET", "PUT", "POST", "DELETE"],
"AllowedOrigins": ["https://*.hostname.com"],
"ExposeHeaders":
[
"Access-Control-Allow-Origin",
"ETag",
"x-amz-server-side-encryption",
"x-amz-request-id",
"x-amz-id-2",
],
"MaxAgeSeconds": 3000,
},
]
If you are using typingmind cloud, use the below
[
{
"AllowedHeaders": ["*"],
"AllowedMethods": ["HEAD", "GET", "PUT", "POST", "DELETE"],
"AllowedOrigins": ["https://www.typingmind.com"],
"ExposeHeaders":
[
"Access-Control-Allow-Origin",
"ETag",
"x-amz-server-side-encryption",
"x-amz-request-id",
"x-amz-id-2",
],
"MaxAgeSeconds": 3000,
},
]
Update “https://*.hostname.com” with your specific hostname in case you are self hosting Typingmind (e.g. https://chat.yourhostname.com
). If you are using Typingmind cloud, hostname should be https://www.typingmind.com
. This restricts executing S3 commands from only the specified hostname providing better security.
Cloudflare R2 provides S3 compatible API with a generous 10GB free storage per month. Refer How to setup Cloudflare R2 and use with this extension iDrive E2 provides S3 compatible API with a generous 10GB free storage per month. Refer How to setup iDrive E2 and use with this extension
For troubleshooting, enable detailed logging:
?log=true
to your URLSymptom: Different item counts between devices (e.g., Device 1 has 467 items, Device 2 has 376 items)
Root Cause: Local metadata corruption/inconsistency
Diagnosis:
Solutions (in order of preference):
Solution 1: Reset metadata on device with CORRECT data
tcs_local-metadata
and tcs_last-cloud-sync
Reload PageSolution 2: Reset metadata on device with MISSING data
tcs_local-metadata
and tcs_last-cloud-sync
Reload PageSolution 3: Complete sync reset (if Solutions 1-2 don’t work)
tcs_local-metadata
, tcs_last-daily-backup
and tcs_last-cloud-sync
Reload PagePrevention:
?log=true
The extension will work reliably only when one device is active at a time. So if you are facing issues, ensure the app is active only on one device at a time.
The extension encrypts the AWS credentials while its stored in the browser database. However, since the encryption key is still stored in plain text, sophisticated hackers who can get access to your browser data and could theoretically get access to your AWS credentials. So, be sure to provide minimum permissions to the AWS credentials. For Amazon S3, I have provided access policy above. However, for other S3 compatible providers, its up to you to setup proper access policies.
I am a passionate developer dedicated to creating useful tools that can benefit the community. My goal is to distribute all of my projects as open source, enabling others to learn, contribute, and innovate together. If you appreciate my work and want to support my efforts, consider buying me a coffee. :heart:!
This project is licensed under the MIT License - see the LICENSE file for details.