Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@cube-dev/embed-sdk

Package Overview
Dependencies
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cube-dev/embed-sdk

React SDK for embedding Cube analytics

latest
npmnpm
Version
0.0.11
Version published
Maintainers
4
Created
Source

@cube-dev/embed-sdk

React SDK for embedding Cube analytics into your applications.

Installation

yarn add @cube-dev/embed-sdk

Peer Dependencies

This package requires the following peer dependencies:

yarn add react react-dom @tanstack/react-query

Quick Start

import { useState } from 'react';
import { EmbedProvider, createDefaultReport, useReportContext } from '@cube-dev/embed-sdk';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

const queryClient = new QueryClient();

function App() {
  const [report, setReport] = useState(() => createDefaultReport({ title: 'My Report' }));

  return (
    <QueryClientProvider client={queryClient}>
      <EmbedProvider
        token={cubeApiToken}
        apiUrl={cubeApiUrl}
        report={report}
        onReportUpdate={(updates) => setReport((prev) => ({ ...prev, ...updates }))}
      >
        <YourAnalyticsComponent />
      </EmbedProvider>
    </QueryClientProvider>
  );
}

Exports

Providers

  • EmbedProvider - Combined provider wrapping all contexts
  • CubeApiContextProvider - Cube API client context
  • DataAssetsContextProvider - Data assets and semantic views context
  • ReportProvider - Report state management context
  • ChartBuilderProvider - Chart building utilities context

Hooks

  • useReportContext - Access report state and actions
  • useChartBuilderContext - Access chart builder utilities
  • useDataAssetsContext - Access data assets and semantic views
  • useActiveCubeApi - Access the Cube API client
  • useReport - Standalone report management hook

Utilities

  • createDefaultReport - Create a new default report with optional title and SQL query
  • parseSemanticSql - Parse semantic SQL queries
  • generateSemanticSql - Generate semantic SQL from logical queries
  • prepareTableData - Prepare data for table rendering
  • prepareChartColumns - Prepare columns for chart rendering

License

MIT

Keywords

cube

FAQs

Package last updated on 04 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts