api.storage

Overview

Where data lives: storages you create with us, databases and buckets you connect, and the devices your code runs on.

6 methodsthree familiesone object type back
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

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

FamilyMade byHolds
IaGenify Cloudcreate({ service })A NoSQL base, an SQL base, or object storage.
Connectedconnect({ type, provider, endpoint })Your own database or bucket, read through us.
Devicesthe 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

MethodDoes
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})
Credentials go in credentials

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

The agent works on the device it was given

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.