Upgrading to 0.13.0

If you haven’t upgraded to 0.9.0 please read the upgrading guide.

Update getPageSnapshot Parameters

1 export async function getStaticProps(ctx) {
2 const makeswift = new Makeswift(process.env.MAKESWIFT_SITE_API_KEY, { runtime })
3
4 const snapshot = await makeswift.getPageSnapshot(path, {
5- preview: ctx.preview,
6+ siteVersion: Makeswift.getSiteVersion(ctx.previewData),
7 locale: ctx.locale,
8 });
9 }

For users who are using versioning

1

Remove the siteVersion parameter from the Makeswift constructor

1 const makeswift = new Makeswift(process.env.MAKESWIFT_SITE_API_KEY, {
2 runtime: runtime,
3-- siteVersion: Makeswift.getSiteVersion(ctx.previewData),
4 });
2

Remove the siteVersion parameter from the MakeswiftApiHandler

1export default MakeswiftApiHandler(process.env.MAKESWIFT_SITE_API_KEY, {
2-- siteVersions: true,
3});

If you use client.getPage, you need to also update the parameters

1 const page = await client.getPage(path, {
2-- preview,
3++ siteVersion: Makeswift.getSiteVersion(ctx.previewData),
4 locale
5 })

Here is the link to the official release notes.