Storage
The SDK exposes an application-scoped fs object backed by fsspec(opens in new tab). Application code uses the same filesystem interface in local development, tests, and production.
| Environment | Storage backend |
|---|---|
Testing | memory backend for isolated in-memory test files. |
Development | file backend for inspectable local files. |
Production | s3 backend using application and shared prefixes in one Organization bucket. |
The LongLink Platform creates one bucket per Organization and gives each application direct IAM credentials. The credentials allow reads and writes in that application's prefix and read-only access to the shared prefix.
Usage
pythonfrom longlink import Envs, create_fsenv = Envs()fs = create_fs(env, env.STORAGE_BUCKET or "", env.STORAGE_PREFIX or "")with fs.open("reports/example.txt", "wb") as f:f.write(b"hello")
Assets
Organization-level assets live in shared storage. The SDK exposes longlink.assets.logo() for the organization logo, using a bundled fallback in development and testing and the organization shared prefix in production. Pass the runtime environment and shared filesystem explicitly.
pythonimport longlink.assets as assetsfrom longlink import Envs, create_fsenv = Envs()shared_fs = create_fs(env, env.STORAGE_BUCKET or "", env.STORAGE_SHARED_PREFIX or "")logo = assets.logo(env, shared_fs)