iceberg-js
    Preparing search index...

    Class IcebergRestCatalog

    Client for interacting with an Apache Iceberg REST Catalog.

    This class provides methods for managing namespaces and tables in an Iceberg catalog. It handles authentication, request formatting, and error handling automatically.

    const catalog = new IcebergRestCatalog({
    baseUrl: 'https://my-catalog.example.com',
    warehouse: 'my-warehouse',
    auth: { type: 'bearer', token: process.env.ICEBERG_TOKEN }
    });

    // First call lazily fetches /v1/config?warehouse=my-warehouse
    await catalog.createNamespace({ namespace: ['analytics'] });
    Index

    Constructors

    Methods

    • Lists all namespaces in the catalog.

      Parameters

      Returns Promise<ListNamespacesResult>

      Paginated namespace list with optional nextPageToken

      const { namespaces } = await catalog.listNamespaces();

      // List children under a parent
      const { namespaces: children } = await catalog.listNamespaces({
      parent: { namespace: ['analytics'] },
      });

      // Paginate
      const page1 = await catalog.listNamespaces({ pageSize: 100 });
      const page2 = await catalog.listNamespaces({ pageSize: 100, pageToken: page1.nextPageToken });
    • Fetch and cache the server's catalog configuration. Subsequent calls return the same object. Calling this is optional — operations will trigger it lazily on first use.

      Caches the in-flight promise (not just the resolved value) so concurrent first-callers don't all fire their own /v1/config request.

      Returns Promise<CatalogConfig>