From 00415dec355193e618cb4ec867ba6afc5204ed7a Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Thu, 30 Nov 2023 13:22:22 -0800 Subject: [PATCH 1/3] make an update to the readme --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index a44997acd..85977859c 100644 --- a/README.md +++ b/README.md @@ -344,6 +344,23 @@ The SDK preregisters the following codecs: }); ``` +### Using custom content types + +```tsx + import { Client } from '@xmtp/xmtp-react-native' + // Create the client with a `Signer` from your application and specify any custom codecs + const xmtp = await Client.create(wallet, { env: 'production', codecs: [new CustomCodec()]}) + // Register the custom codec so you can encode and decode it + xmtp.register(new CustomCodec()) + // Use the content type name from you custom codec when sending messages with them + await conversation.send(, { contentType: ContentTypeCustom }) +``` + +To learn more about how to build a custom content type, see [Build a custom content type](https://xmtp.org/docs/content-types/introduction#create-custom-content-types). + +Custom codecs and content types may be proposed as interoperable standards through XRCs. To learn about the custom content type proposal process, see [XIP-5](https://github.com/xmtp/XIPs/blob/main/XIPs/xip-5-message-content-types.md). + + ## Manually handle private key storage The SDK will handle key storage for the user by encrypting the private key bundle using a signature generated from the wallet, and storing the encrypted payload on the XMTP network. This can be awkward for some server-side applications, where you may only want to give the application access to the XMTP keys but not your wallet keys. Mobile applications may also want to store keys in a secure enclave rather than rely on decrypting the remote keys on the network each time the application starts up. From bdec8d9e31bec6cc02415b07e384df505429c9f7 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Thu, 30 Nov 2023 13:23:29 -0800 Subject: [PATCH 2/3] remove extra space --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 85977859c..748fb211b 100644 --- a/README.md +++ b/README.md @@ -360,7 +360,6 @@ To learn more about how to build a custom content type, see [Build a custom cont Custom codecs and content types may be proposed as interoperable standards through XRCs. To learn about the custom content type proposal process, see [XIP-5](https://github.com/xmtp/XIPs/blob/main/XIPs/xip-5-message-content-types.md). - ## Manually handle private key storage The SDK will handle key storage for the user by encrypting the private key bundle using a signature generated from the wallet, and storing the encrypted payload on the XMTP network. This can be awkward for some server-side applications, where you may only want to give the application access to the XMTP keys but not your wallet keys. Mobile applications may also want to store keys in a secure enclave rather than rely on decrypting the remote keys on the network each time the application starts up. From bbea7f98b8e26c4288ca1df4ea8171d3d217b1a2 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Thu, 30 Nov 2023 14:51:27 -0800 Subject: [PATCH 3/3] Update src/lib/NativeCodecs/ReadReceiptCodec.ts --- src/lib/NativeCodecs/ReadReceiptCodec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/NativeCodecs/ReadReceiptCodec.ts b/src/lib/NativeCodecs/ReadReceiptCodec.ts index 5d2fb98a0..e99979e3c 100644 --- a/src/lib/NativeCodecs/ReadReceiptCodec.ts +++ b/src/lib/NativeCodecs/ReadReceiptCodec.ts @@ -28,6 +28,6 @@ export class ReadReceiptCodec } fallback(content: object): string | undefined { - return 'read' + return undefined } }