Remote bindings
Remote bindings let your hosted backend use a published Storage, Key, or AI resource without deploying that backend into the customer environment.
hosted backend → short-lived binding → published customer resourcePublish only the resource you need
import * as alien from "@alienplatform/core"
const uploads = new alien.Storage("uploads").build()
export default new alien.Stack("customer-storage")
.add(uploads, "frozen", { remoteAccess: true })
.build()remoteAccess: true publishes that resource to the remote-binding registry. It does not publish every resource in the stack.
Connect from your backend
Use a project API key created for Remote Bindings:
alien api-keys create --for remote-bindingsThen resolve the customer by the same external ID used during setup:
import { Bindings } from "@alienplatform/bindings"
const bindings = await Bindings.forRemoteCustomer({
project: "my-project",
externalId: customer.id,
token: process.env.ALIEN_API_TOKEN!,
})
const uploads = bindings.storage("uploads")
await uploads.put("report.txt", Buffer.from("hello"))
const result = await uploads.get("report.txt")
console.log(result.data.toString("utf8"))You can also address a known deployment with Bindings.forRemoteDeployment({ deploymentId, token }).
Remote Storage exposes get, put, delete, list, and head. Remote Key exposes encrypt and decrypt. AI returns a short-lived provider configuration through bindings.ai().
The operation still crosses environments. Review the request and response data exactly as you would for any hosted API integration.
See the complete Resource APIs and the runnable customer storage example.