Account Setup
When integrating with Stash, one of the first things to decide is how your application's environments map to Stash accounts. There are two common approaches — you can mix them, and add or change accounts later, so nothing here is a permanent commitment.
Option 1 — Separate Stash environments
Point each application environment at its own Stash instance.
| Your environment | Stash environment | Example client-id |
|---|---|---|
| Production | Stash Prod | myapp |
| Non-prod | Stash Test | myapp |
Test files expire after 30 days
In Stash Test, file assets automatically expire 30 days after upload. This keeps test storage costs down, but it means Stash Test is not intended for long-term persistence.
Best when your non-prod environments should talk to a genuinely separate Stash instance and you don't need test files to persist.
Option 2 — Production only, with multiple accounts
Instead of a separate test instance, create multiple accounts (client-ids) in Stash Prod:
myappmyapp-testmyapp-dev(optional)
Developers choose this when:
- You clone your production database down to lower environments and want those environments to still resolve and download the real files — no broken links — or
- You need non-prod data to persist indefinitely (no 30-day expiration).
Read-only sharing between accounts
By default, a myapp-test or myapp-dev account can only access the files it uploaded. It has no access to the production account's files unless sharing is explicitly enabled.
To make Option 2 work smoothly, the production account shares its files read-only with the test/dev accounts. Then, when your production database is cloned down, the lower environments resolve the same file references and can download them.
- Sharing is always read-only.
- It can be granted or revoked at any time.
- It can be all files or per file by UUID.
Example
Some teams run three production accounts — prod, test, and dev — with prod sharing read-only to the other two. When the production database is cloned down, the lower environments still have working, downloadable file links.
Refreshing test data
A test account has full control over the files it uploads. If you later refresh a non-prod environment and its uploaded files become orphaned, we can bulk-expire those orphaned files to clean things up.
Getting started
- Which approach fits each of your application's environments (a mix is fine), and
- The client-id(s) you'd like.
We'll take it from there — and we can add accounts or adjust sharing as your needs change.
Are you an existing UI Files Client? Take a look at our migration guide to see how to upgrade your existing integrations to use Stash.