@synonymdev/pubky 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/browser.js +16 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,19 +26,22 @@ await client.signup(keypair, homeserver)
|
|
|
26
26
|
|
|
27
27
|
const publicKey = keypair.public_key();
|
|
28
28
|
|
|
29
|
+
// Pubky URL
|
|
30
|
+
let url = `pubky://${publicKey.z32()}/pub/example.com/arbitrary`;
|
|
31
|
+
|
|
29
32
|
// Verify that you are signed in.
|
|
30
33
|
const session = await client.session(publicKey)
|
|
31
34
|
|
|
32
35
|
const body = Buffer.from(JSON.stringify({ foo: 'bar' }))
|
|
33
36
|
|
|
34
37
|
// PUT public data, by authorized client
|
|
35
|
-
await client.put(
|
|
38
|
+
await client.put(url, body);
|
|
36
39
|
|
|
37
40
|
// GET public data without signup or signin
|
|
38
41
|
{
|
|
39
42
|
const client = new PubkyClient();
|
|
40
43
|
|
|
41
|
-
let response = await client.get(
|
|
44
|
+
let response = await client.get(url);
|
|
42
45
|
}
|
|
43
46
|
```
|
|
44
47
|
|