Vue Storefront is now Alokai! Learn More
@vsf-enterprise/storyblok-api

@vsf-enterprise/storyblok-api

2.0.0

Major Changes

  • CHANGED The library now communicates with the Storyblok Delivery API via storybloj-js-client instead of storyblok-js. The bridge property is no longer supported by the package configuration and should be removed.

apps/storefront-middleware/sf-modules/cms-storyblok/config.ts

import type { MiddlewareConfig } from "@vsf-enterprise/storyblok-api";
import type { Integration } from "@vue-storefront/middleware";

const { STORYBLOK_ACCESS_TOKEN, STORYBLOK_REGION } = process.env;

if (!STORYBLOK_ACCESS_TOKEN) throw new Error("Missing env var: STORYBLOK_ACCESS_TOKEN");
if (!STORYBLOK_REGION) throw new Error("Missing env var: STORYBLOK_REGION");

export const config = {
  location: "@vsf-enterprise/storyblok-api/server",
  configuration: {
-   bridge: true,
    apiOptions: {
      accessToken: STORYBLOK_ACCESS_TOKEN,
      region: STORYBLOK_REGION,
      cache: {
        type: "memory",
      },
    },
    unified: {
      resolvePages: () => ({
        "/category{/*slug}": {
          path: "category",
        },
        "/product{/*slug}": {
          path: "product",
        }
      }),
      resolveFallbackPage: () => ({
        path: "fallback-page",
      }),
    },
  },
} satisfies Integration<MiddlewareConfig>;

2.0.0-rc.0

Major Changes

  • CHANGED The library now communicates with the Storyblok Delivery API via storybloj-js-client instead of storyblok-js. The bridge property is no longer supported by the package configuration and should be removed.

apps/storefront-middleware/sf-modules/cms-storyblok/config.ts

import type { MiddlewareConfig } from "@vsf-enterprise/storyblok-api";
import type { Integration } from "@vue-storefront/middleware";

const { STORYBLOK_ACCESS_TOKEN, STORYBLOK_REGION } = process.env;

if (!STORYBLOK_ACCESS_TOKEN) throw new Error("Missing env var: STORYBLOK_ACCESS_TOKEN");
if (!STORYBLOK_REGION) throw new Error("Missing env var: STORYBLOK_REGION");

export const config = {
  location: "@vsf-enterprise/storyblok-api/server",
  configuration: {
-   bridge: true,
    apiOptions: {
      accessToken: STORYBLOK_ACCESS_TOKEN,
      region: STORYBLOK_REGION,
      cache: {
        type: "memory",
      },
    },
    unified: {
      resolvePages: () => ({
        "/category{/*slug}": {
          path: "category",
        },
        "/product{/*slug}": {
          path: "product",
        }
      }),
      resolveFallbackPage: () => ({
        path: "fallback-page",
      }),
    },
  },
} satisfies Integration<MiddlewareConfig>;

1.0.0

Major Changes

  • ADDED Initial version of the package
  • ADDED Normalizer for story objects.
  • ADDED Normalizer for plugin fields.
  • CHANGED Passing version param to the unified getPage() method is no longer needed. It is now derived from the presence of the _storyblok query parameter.
  • CHANGED The GetPageArgs interface (which describes params object accepted of the unified getPage() method) now includes a storyParams object which is passed down as the second argument to the getStory() method of the Storyblok SDK.
  • CHANGED Entries returned by resolvePages() now have to implement the GetPageArgs interface.

Patch Changes

FIXED getPage method optional params

  • Updated dependencies:
    • @vsf-enterprise/cms-components-utils@2.1.0

1.0.0-rc.2

Patch Changes

FIXED getPage method optional params

1.0.0-rc.1

Major Changes

  • ADDED Normalizer for story objects.
  • ADDED Normalizer for plugin fields.
  • CHANGED Passing version param to the unified getPage() method is no longer needed. It is now derived from the presence of the _storyblok query parameter.
  • CHANGED The GetPageArgs interface (which describes params object accepted of the unified getPage() method) now includes a storyParams object which is passed down as the second argument to the getStory() method of the Storyblok SDK.
  • CHANGED Entries returned by resolvePages() now have to implement the GetPageArgs interface.

1.0.0-rc.0

Major Changes

  • ADDED Initial version of the package