Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update client docs to show how to properly delegate recovery #78

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/pages/docs/w3up-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,7 @@ Now you may provision your space with your account:
await myAccount.provision(space.did())
```

Once provisioned, it's a good idea to setup recovery, so that when you move to a different device you can still access your space:

```js
await space.createRecovery(myAccount.did())
```
ℹ️ Note: creating a space and provisioning it needs to happen only **once**!

Finally, save your space to your agent's state store:

Expand All @@ -90,7 +86,17 @@ If your agent has no other spaces, saving the space will set it as the "current
await client.setCurrentSpace(space.did())
```

ℹ️ Note: creating a space and provisioning it needs to happen only **once**!
One last thing - now that you've saved your space locally, it's a good idea to setup recovery, so that when you move to a different device you can still access your space:

```js
const recovery = await space.createRecovery(myAccount.did())
await client.capability.access.delegate({
space: space.did(),
delegations: [recovery],
})
```

ℹ️ Note: If you do not create and delegate space recovery you run the risk of losing access to your space!

## Upload files

Expand Down