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

Revamp docs left nav #33

Merged
merged 16 commits into from
Sep 16, 2024
Merged

Revamp docs left nav #33

merged 16 commits into from
Sep 16, 2024

Conversation

jhaaaa
Copy link
Collaborator

@jhaaaa jhaaaa commented Sep 9, 2024

Preview: https://docs-xmtp-org-git-revamp-doc-nav-ephemerahq.vercel.app/

  • Revamp left nav to create main sections based on the primary builder use cases
  • Add a homepage that provides a tile per builder use case. The tile enables us to further highlight the use cases -- as well as provide a short description of each use case.
  • Combine the existing 1:1 chat "Create a client" section with the existing group chat "Create a client" section to provide a common "Create a client" section that works for both 1:1 and group chat.

Create redirect

https://docs.xmtp.org/dms/client to https://docs.xmtp.org/client/create-client

To do:

  • Reorg directories and files to match left nav structure. I will do this once we've agreed that the left nav structure is solid.
  • I will continue to work on making V3 the default state of the docs.
  • Known issue: When loaded, the left nav sections should be collapsed. This is a known issue with Vocs: When visiting root page all sidebars are opened wevm/vocs#151

Copy link

vercel bot commented Sep 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-xmtp-org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 16, 2024 11:33pm

@@ -750,7 +840,21 @@ let client = try await Client.create(account: account, options: clientOptions)
<th>Parameter</th>
<th>Default</th>
<th>Description</th>
<th></th>
</tr>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the following options be added for RN?

    dbDirectory = "mydbdir", // Optional: specify database directory
    dbEncryptionKey = ByteArray(32) // Optional: 32-byte array for database

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dbEncryptionKey is not optional if you use V3

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But should be added to RN for sure.


For more information about wallet signature requests, see [Account signatures](/protocol/signatures).

Clients created by XMTP v3 SDKs also support XMTP v2 messages. At a high-level, XMTP v3 is used to support group chat and XMTP v2 is used to support 1:1 chat.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also support xmtp v2 messages if the wallet is an EOA.

docs/pages/dms/client.mdx Outdated Show resolved Hide resolved

[Use client configuration options](#configure-the-client) to change parameters of a client's network connection.
Regardless of whether your app provides group chat, set the `enableV3` client option to `true` to benefit from other aspects of the upgraded XMTP v3 protocol.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note you will not loose v2 functionality by doing this.

const xmtp = await Client.create(signer, { env: "dev" });
const xmtp = await Client.create(signer, {
env: "production",
enableV3: true, // Enable group chat support
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not support v3 at the moment so probably shouldnt add here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nplasterer Ah, thank you for this - I took it too far! I thought the guidance to have everyone enableV3 meant that at least the flag was available in all SDKs and everyone should set this value. But what we mean is that all apps built with Kotlin, Swift, RN, and Node should set enableV3 to true. GOT IT - thank you!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the code comment is incorrect 😭. So sorry... I promise I know that group chat is not available for web yet.

docs/pages/dms/client.mdx Outdated Show resolved Hide resolved
docs/pages/dms/client.mdx Outdated Show resolved Hide resolved
env: "production",
enableV3: true, // Enable group chat support
dbDirectory: "mydbdir", // Optional: specify database directory
dbEncryptionKey: new Uint8Array(32), // Optional: 32-byte array for database encryption
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dbEncryptionKey: new Uint8Array(32), // Optional: 32-byte array for database encryption
dbEncryptionKey: new Uint8Array(32), // Required 32-byte array for database encryption if enableV3 is true

<tr>
<td>dbEncryptionKey</td>
<td>null</td>
<td>Optional. If not provided, a key is created and stored for you.</td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now Required. We don't create or store keys anymore.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could link to the recommended key storage in kotlin https://developer.android.com/privacy-and-security/keystore

<tr>
<td>dbEncryptionKey</td>
<td>null</td>
<td>Optional. If not provided, the database remains unencrypted.</td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -750,7 +840,21 @@ let client = try await Client.create(account: account, options: clientOptions)
<th>Parameter</th>
<th>Default</th>
<th>Description</th>
<th></th>
</tr>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But should be added to RN for sure.

Co-authored-by: Naomi Plasterer <[email protected]>
jhaaaa and others added 2 commits September 16, 2024 10:01
Co-authored-by: Naomi Plasterer <[email protected]>
Co-authored-by: Naomi Plasterer <[email protected]>
@jhaaaa jhaaaa merged commit 6f3d11d into main Sep 16, 2024
2 checks passed
@jhaaaa jhaaaa deleted the revamp-doc-nav branch September 16, 2024 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants