JSPM

  • Created
  • Published
  • Downloads 196
  • Score
    100M100P100Q88351F
  • License MIT

Type definition of NubeSDK

Package Exports

  • @tiendanube/nube-sdk-types
  • @tiendanube/nube-sdk-types/src/index.ts

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tiendanube/nube-sdk-types) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@tiendanube/nube-sdk-types

TypeScript definitions for NubeSDK, ensuring safety, consistency, and better integration with IDEs and code editors.

@tiendanube/nube-sdk-types provides well-defined TypeScript types for NubeSDK, simplifying the development of third-party apps within the Nuvemshop platform.

Apps in NubeSDK run inside isolated web workers, without direct access to the DOM. This package standardizes data structures, events, and interfaces, ensuring type safety and consistency in communication with the platform.

Installation

npm install -D @tiendanube/nube-sdk-types

Main Types

This package provides essential type definitions for NubeSDK integration, including:

Application State

NubeSDKState → Represents the SDK's global state (cart, store, UI, etc.).

Events

  • NubeSDKSendableEvent → Events that can be sent to the SDK.
  • NubeSDKListenableEvent → Events that apps can listen to.
  • NubeSDKListener → Function signature for event handlers.

Data Models

  • Cart → Represents the shopping cart structure.
  • Store → Information about the store where the apps is running.
  • AppLocation → Represents the user's current page within the platform.

UI Components

  • NubeComponent → Declarative representation of a UI component.
  • NubeComponentBox, NubeComponentRow, NubeComponentField, etc.

Example Usage

import type { NubeSDK, NubeSDKState } from "@tiendanube/nube-sdk-types";

function App(nube: NubeSDK) {
  nube.on("cart:update", (state: NubeSDKState) => {
    console.log("Cart updated:", state.cart);
  });
}

Example Project Setup

A minimal example project using @tiendanube/nube-sdk-types is available in the repository under:

This example include pre-configured build setups, ensuring a seamless development experience.

Official Documentation

For more details about NubeSDK and how to build apps, check out our official documentation:

🔗 NubeSDK Documentation

Support

  • Questions? Use GitHub Issues.
  • Found a bug? Open an issue with a reproducible example.

© Tiendanube / Nuvemshop, 2025. All rights reserved.