Skip to main content

Arguments

  1. string
    required
    The API key for the Makeswift site.
  2. object
    required
    Options for site version and locale.

Examples

App Router

src/app/api/makeswift/[...makeswift]/route.ts

Pages router

src/pages/api/makeswift/[...makeswift].ts

Adding fonts

The following example adds Spline Sans and Spline Sans Mono Google Fonts to the site using next/font and adds them to the MakeswiftApiHandler. For more information on adding fonts to your Next.js app, see our Adding Fonts guide.
We recommend using variable fonts as they reduce the number of font files requested.

Using onPublish event