constructor

The Makeswift client is used to fetch data from the Makeswift API.

Arguments

apiKey
stringRequired

The API key for the Makeswift site.

options
object

Options for a runtime instance.

runtime
ReactRuntime

A runtime instance. Required for custom breakpoints.

Example

The following example instantiates a new Makeswift client.

src/makeswift/client.ts
1import { Makeswift } from "@makeswift/runtime/next";
2import { strict } from "assert";
3
4import { runtime } from "./runtime";
5
6strict(
7 process.env.MAKESWIFT_SITE_API_KEY,
8 "MAKESWIFT_SITE_API_KEY is required"
9);
10
11export const client = new Makeswift(process.env.MAKESWIFT_SITE_API_KEY, {
12 runtime,
13});