@kelet-ai/feedback-ui 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -319,23 +319,6 @@ const [data, setData] = useFeedbackState(initial, 'tracker', {
319
319
 
320
320
  ---
321
321
 
322
- ## 🔗 OpenTelemetry Integration
323
-
324
- Automatically extract trace IDs to correlate feedback with distributed traces:
325
-
326
- ```tsx
327
- import { VoteFeedback, getOtelTraceId } from '@kelet-ai/feedback-ui';
328
-
329
- <VoteFeedback.Root tx_id={getOtelTraceId} onFeedback={handleFeedback}>
330
- <VoteFeedback.UpvoteButton>👍</VoteFeedback.UpvoteButton>
331
- <VoteFeedback.DownvoteButton>👎</VoteFeedback.DownvoteButton>
332
- </VoteFeedback.Root>;
333
- ```
334
-
335
- Requires `@opentelemetry/api` and active Span to collect the trace_id from.
336
-
337
- ---
338
-
339
322
  ## 🔧 Core Components
340
323
 
341
324
  ### **VoteFeedback.Root**
@@ -2160,43 +2160,10 @@ function useFeedbackState(initialState, tx_id, options) {
2160
2160
  );
2161
2161
  return [state, setState];
2162
2162
  }
2163
- let _loadOtelApi = () => {
2164
- try {
2165
- return require("@opentelemetry/api");
2166
- } catch {
2167
- throw new Error(
2168
- "OpenTelemetry is not available. Install @opentelemetry/api to use trace ID extraction."
2169
- );
2170
- }
2171
- };
2172
- function getOtelTraceId() {
2173
- const { trace, context } = _loadOtelApi();
2174
- try {
2175
- const spanContext = trace.getSpanContext(context.active());
2176
- if (spanContext?.traceId) {
2177
- return spanContext.traceId;
2178
- }
2179
- const activeSpan = trace.getSpan(context.active());
2180
- if (activeSpan) {
2181
- const spanCtx = activeSpan.spanContext();
2182
- if (spanCtx.traceId) {
2183
- return spanCtx.traceId;
2184
- }
2185
- }
2186
- } catch (error) {
2187
- throw new Error(
2188
- `Failed to extract OpenTelemetry trace ID: ${error instanceof Error ? error.message : "Unknown error"}`
2189
- );
2190
- }
2191
- throw new Error(
2192
- "OpenTelemetry trace ID not available. Ensure XHR/Fetch instrumentation is active and a request is in progress."
2193
- );
2194
- }
2195
2163
  export {
2196
2164
  KeletContext,
2197
2165
  KeletProvider,
2198
2166
  VoteFeedback,
2199
- getOtelTraceId,
2200
2167
  useDefaultFeedbackHandler,
2201
2168
  useFeedbackState,
2202
2169
  useKelet