Cobbl
CobblPublicClient

Overview

Client-side SDK for collecting user feedback

The CobblPublicClient is designed for client-facing operations that don't require authentication. Use this client when you need to collect user feedback in browser environments.

When to Use CobblPublicClient

  • Submitting user feedback for prompt runs
  • Updating feedback with additional details
  • Browser-based applications (React, Vue, vanilla JS)
  • Any public-facing context where users interact with AI outputs

Installation

npm install @cobbl-ai/sdk

Initialization

import { CobblPublicClient } from '@cobbl-ai/sdk'

const publicClient = new CobblPublicClient()

No configuration is required for production use!

Methods

createFeedback

Create new feedback for a prompt run.

const { id } = await publicClient.createFeedback({
  runId: 'run_abc123',
  helpful: 'helpful',
  userFeedback: 'Great response!',
})
ParameterTypeRequiredDescription
runIdstringYesThe run ID from runPrompt()
helpful'helpful' | 'not_helpful'No*Whether the output was helpful
userFeedbackstringNo*Detailed feedback message

updateFeedback

Update existing feedback with additional data.

await publicClient.updateFeedback(feedbackId, {
  userFeedback: 'Actually, could use more detail on the second point.',
})
ParameterTypeRequiredDescription
idstringYesThe feedback ID from createFeedback
helpful'helpful' | 'not_helpful'NoUpdate the helpfulness rating
userFeedbackstringNoUpdate the feedback text

See Collecting Feedback for detailed usage examples.

Import Patterns

Namespaced Import

For optimal tree-shaking and bundle size:

import { CobblPublicClient } from '@cobbl-ai/sdk'

Next Steps

On this page