Everything here hands back the same kind of object — a ConnectedStorage — whatever is behind it. That is the point: your code reads a database the same way whether we host it or you connected it.
Three families
| Family | Made by | Holds |
|---|---|---|
| IaGenify Cloud | create({ service }) | A NoSQL base, an SQL base, or object storage. |
| Connected | connect({ type, provider, endpoint }) | Your own database or bucket, read through us. |
| Devices | the SDK, or device() | A computer or a phone — its files stay on it. |
A computer registers itself the first time the SDK runs on it; you never call anything for that. A phone cannot register itself — the SDK is not on it — so device() exists for that one case.
The methods
| Method | Does |
|---|---|
| create({ service, label }) | Opens an IaGenify Cloud storage. No credentials to supply. |
| connect({ label, type, provider, endpoint }) | Registers one of yours. |
| device({ deviceId, name, userAgent }) | Registers a phone. |
| get({ id }) | One storage, or the default with no argument. |
| list() | All of them, newest first. |
| remove(id) | Disconnects or deletes one. |
What it looks like
// Ours — nothing to configure
const base = await api.storage.create({ service: "nosql", label: "App data" });
// Yours — put the URI in credentials, which is encrypted
const mongo = await api.storage.connect({
label: "Prod", type: "database", provider: "mongodb",
endpoint: { credentials: { uri: "mongodb+srv://…/mydb" } },
});
// Read either one the same way
await base.run({ action: "collections" });
await mongo.run({ action: "find", collection: "users", filter: {}, options: { limit: 20 } });# Ours — nothing to configure
base = api.storage.create(service="nosql", label="App data")
# Yours — put the URI in credentials, which is encrypted
mongo = api.storage.connect(
label="Prod", type="database", provider="mongodb",
endpoint={"credentials": {"uri": "mongodb+srv://…/mydb"}},
)
# Read either one the same way
base.run(action="collections")
mongo.run(action="find", collection="users", filter={}, options={"limit": 20})Put the connection URI inside endpoint.credentials, which is encrypted at rest. A storage never hands its endpoint back — the server uses it to connect, and you are the one who supplied it.
The default
Every account is created with its own object storage, and that one carries the default flag — so a save with no target has somewhere to go. Exactly one active storage carries it; delete that one and the flag is handed to another rather than left nowhere.
A storage is not where an agent works
machine is a separate choice from the default storage. An agent reads the disk it is on; connected storages are things it queries, not where it lives.