Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@vue-storefront/magento-sdk is deprecated #1561

Open
NyllRE opened this issue Dec 16, 2024 · 0 comments
Open

@vue-storefront/magento-sdk is deprecated #1561

NyllRE opened this issue Dec 16, 2024 · 0 comments

Comments

@NyllRE
Copy link

NyllRE commented Dec 16, 2024

Whenever I try to use the magento sdk it keeps saying that it's deprecated and to use the vsf-enterprise module or magento2-sdk, the thing is the magento2-sdk doesn't even exist and the @vsf-enterprise module just isn't available. this is a very big breaking issue and it's stopping my process. this is the message that comes when hovering on the function:

image

@deprecated
Use middlewareModule instead.

- import { initSDK, buildModule } from '@vue-storefront/sdk';
- import { magentoModule } from '@vsf-enterprise/magento-sdk'
+ import { initSDK, buildModule, middlewareModule } from '@vue-storefront/sdk';
+ import { Endpoints as MagentoEndpoints } from '@vsf-enterprise/magento-api';
const sdkConfig = {
  magneto:
    buildModule(
-      magentoModule,
+      middlewareModule<MagentoEndpoints>,
      { apiUrl: 'http://localhost:8181/magneto' }
    )
};

export const sdk = initSDK(sdkConfig);

// Breaking changes:
// - Custom queries are now a second argument of the methods.

const customQuery = {
  cart: 'cart-custom-query',
  metadata: {
    fields: 'id items { uid }'
  }
};
- const cart = await sdk.magento.cart({ cartId: '123'}, { customQuery });
+ const cart = await sdk.magento.cart({ cartId: '123'}, customQuery);

@example
Initialization of the Magento module.

import { initSDK, buildModule } from '@vue-storefront/sdk';
import { magentoModule, MagentoModuleType } from '@vue-storefront/magento2-sdk'

const sdkConfig = {
  magento:
    buildModule(
      magentoModule,
      {
        apiUrl: 'http://localhost:8181/magento',
      }
    )
};

export const sdk = initSDK<typeof sdkConfig>(sdkConfig);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant