Hyvä Themes - GraphQL Tokens module

hyva-themes/magento2-graphql-tokens

Adds GraphQL tokens (signin, cartId, storeViewCode) to customer and cart sections. Enables GraphQL calls from Magento templates, supporting guest carts and store code settings.

Installs cleanlyBuild passingsilver partnerSemVer compliant

Supported Magento versions: 2.4.9

3,172,041 installs★ 24 starsLatest: v1.0.4Released 2021-08-23License: BSD-3-Clause

composer require hyva-themes/magento2-graphql-tokens

README

Reproduced from the package’s own README, under its own license, as of 2026-09-13. Links and images point back at the source repository.

Hyvä Themes - GraphQL Tokens module

Hyvä Themes

hyva-themes/magento2-graphql-tokens

Supported Magento Versions

This module adds GraphQL tokens to the CustomerData sections to enable GraphQL calls from a Magento template.

Compatible with Magento 2.3.4 and higher.

What does it do?

It adds:

  • signin_token to the customer section
  • cartId to the cart section
  • storeViewCode to the cart section

The CartId is the masked cartId that is needed for guest carts. The storeViewCode is needed to set the store-code on GraphqQl requests.

When logged in, the customer signin_token can be used to get the real cart id.

Installation

  1. Install via composer
    composer config repositories.hyva-themes/magento2-graphql-tokens git git@github.com:hyva-themes/magento2-graphql-tokens.git
    composer require hyva-themes/magento2-graphql-tokens
    
  2. Enable module
    bin/magento setup:upgrade
    

Configuration

No configuration needed.

How does it work?

There are after-plugins that add the tokens to the individual sections.

If a token already exists, it uses the existing one. Otherwise, a fresh token is generated on the fly.

Credits

License

This package is licensed under the Open Software License (OSL 3.0).

  • Copyright: Copyright © 2020-present Hyvä Themes. All rights reserved.
  • License Text (OSL 3.0): The full text of the OSL 3.0 license can be found in the LICENSE.txt file within this package, and is also available online at http://opensource.org/licenses/osl-3.0.php.
← All packages from hyva-themes