/ src / index.ts
index.ts
 1  /**
 2   * Common Ground Bot SDK
 3   * 
 4   * Build bots for Common Ground communities.
 5   * 
 6   * @example
 7   * ```typescript
 8   * import { BotClient } from '@anthropic-internal/cg-bot-sdk';
 9   * 
10   * const bot = new BotClient({ token: process.env.BOT_TOKEN });
11   * 
12   * await bot.sendMessage({
13   *   communityId: 'your-community-id',
14   *   channelId: 'your-channel-id',
15   *   text: 'Hello from my bot!',
16   * });
17   * ```
18   */
19  
20  // Client
21  export { BotClient } from './client.js';
22  
23  // Webhook utilities
24  export { 
25    verifyWebhook, 
26    parseWebhook, 
27    webhookMiddleware,
28    type VerifyWebhookOptions 
29  } from './webhook.js';
30  
31  // Errors
32  export { BotApiError, WebhookVerificationError } from './errors.js';
33  
34  // Types
35  export type {
36    // Config
37    BotClientConfig,
38    
39    // Messages
40    MessageBody,
41    MessageContentItem,
42    TextContent,
43    LinkContent,
44    MentionContent,
45    BotMentionContent,
46    NewlineContent,
47    
48    // Attachments
49    Attachment,
50    ImageAttachment,
51    LinkPreviewAttachment,
52    
53    // API
54    SendMessageOptions,
55    SendMessageResult,
56    Message,
57    
58    // Webhooks
59    WebhookEvent,
60    WebhookEventType,
61    WebhookCommunity,
62    WebhookChannel,
63    WebhookMessage,
64    WebhookSender,
65    WebhookMentionedBot,
66    
67    // Errors
68    ApiErrorResponse,
69  } from './types.js';
70