Skip to main content

NPM Package

@commercengine/checkout

Vue integration for Commerce Engine Checkout.

Installation

Setup

Call initCheckout once at your app’s entry point. The SDK resolves the hosted URL from storeId + environment using store-specific subdomains:
main.ts

Use the composable

useCheckout() returns reactive refs and action methods. Call it inside setup() or <script setup>.
CartButton.vue

Full example

App.vue

Nuxt

For Nuxt 3, create a plugin to initialize checkout:
plugins/checkout.client.ts
The .client.ts suffix ensures this only runs in the browser. Then use useCheckout() in any component.
Feature flags, login methods, drawer direction, and payment provider are managed in Checkout Studio (Config API), not as SDK init options. Use theme only for per-session overrides.

Syncing external auth

AuthSync.vue

Composable API reference

useCheckout() returns: All state properties are readonly Vue refs. They update automatically when the checkout state changes and clean up on component unmount.