> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sageprotocol.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Posting Content in Channels

>  

Only users who follow channels can create posts within them. Channel posts support rich markdown content, including formatting, images, and embedded links.

**React Hook Example for Posting Content in Channels**:

```typescript theme={null}
import { usePost } from '@sageprotocol/sdk/react';
import { useWallet } from '@suiet/wallet-kit';

function PostToChannel({ channelId, ownedUserId }) {
  const { postToChannel } = usePost();
  const { account, signAndExecuteTransaction } = useWallet();

  async function handlePost() {
    const result = await postToChannel({
      amounts: [0, 0],                           // Required, typically [0, 0]
      appId: 'your-app-id',                      // Explicitly required application ID
      network: 'testnet',                        // Required network ('testnet' or 'mainnet')
      channelId,                                 // Channel ID where post is created
      data: 'Sui offers significantly higher transaction throughput...', // Main markdown content
      description: 'Performance and scalability comparison',             // Markdown summary
      title: 'Understanding Sui vs Ethereum',    // Post title in markdown
      ownedUserId,                               // Poster’s owned user ID
      self: account.address                      // Poster’s wallet address
    });

    if (result.ok) {
      await signAndExecuteTransaction({ transaction: result.transaction });
      console.log("Posted to channel successfully!");
    } else {
      console.error("Error posting to channel:", result.err);
    }
  }

  return <button onClick={handlePost}>Post Content</button>;
}

export default PostToChannel;
```

<Accordion title="Direct Javascript Example for Posting Content in Channels" icon="rectangle-code" iconType="sharp-solid">
  ```javascript theme={null}
  import { SageClient } from '@sageprotocol/sdk';

  const sageClient = new SageClient({
    appId: 'your-app-id',                    // Required application ID
    channelRegistryId: 'your-registry-id',   // Required channel registry ID
    network: 'testnet'                       // 'testnet' or 'mainnet'
  });

  await sageClient.initialize();

  async function postToChannel(channelId, ownedUserId, walletAddress) {
    const result = await sageClient.postToChannel({
      amounts: [0, 0],                            // Required, typically [0, 0]
      channelId,                                  // Channel ID where post is created
      data: 'Sui offers significantly higher transaction throughput...', // Main markdown content
      description: 'Performance and scalability comparison',             // Markdown summary
      title: 'Understanding Sui vs Ethereum',     // Post title in markdown
      ownedUserId,                                // Poster’s owned user ID
      self: walletAddress                         // Poster’s wallet address
    });

    if (result.ok) {
      await signAndExecuteTransaction({ transaction: result.transaction });
      console.log("Posted to channel successfully!");
    } else {
      console.error("Error posting to channel:", result.err);
    }
  }

  postToChannel('your-channel-id', 'your-owned-user-id', walletAddress);
  ```
</Accordion>

##
