Craft Commerce Integration Demo
Authentication
Login
Shopping Cart
Implementation Notes
This demo page showcases the integration of the Craft Commerce Headless SDK with Nuxt 3. The SDK provides native session-based authentication and cart management, which is more compatible with Craft Commerce than the previous GraphQL Authentication plugin approach.
Key Components:
- Authentication - Uses native Craft CMS session-based authentication
- Cart Management - Leverages the Craft Commerce cart controller actions
- User Management - Provides profile management with the native Craft user controller
Implementation Details:
- The SDK is initialized in
plugins/craft-commerce-sdk.ts
- Authentication logic is in
composables/useCraftCommerceAuth.ts
- Cart functionality is in
composables/useCraftCommerceCart.ts
- Payment handling is in
composables/useCraftCommercePayment.ts
This implementation works alongside the existing GraphQL Authentication system, allowing for a gradual transition to the new approach.