alice and bob are SDK instances that have
already completed signIn().
Create and use a delegation
Use the recipient’s owner DID. After wallet sign-in,bob.did is that owner
DID; bob.sessionDid identifies the ephemeral session key instead.
useDelegation() returns a DelegatedAccess handle for the delegator’s space.
Its KV service is already rooted at shared/, so its keys are relative to that
delegated path. It does not copy the data into the recipient’s space.
Serialize for transport
createDelegation() returns a PortableDelegation object. To send it as text,
use the SDK helpers instead of manually converting its Date fields:
@tinycloud/web-sdk for browser applications.
The serialized delegation is a bearer credential; do not log it or send it
through an untrusted channel.
Narrow access further
If the parent permits sub-delegation, Bob can grant Carol a narrower subset:Revoke access
Both the Node and Web SDKs exposerevokeDelegation():
revokeDelegation() when access must end now.
Inspect received grants
The Node SDK records delegations installed byuseDelegation():
