Skip to main content

StrapiAdapter

Upgather SDK


Upgather SDK / StrapiAdapter

Class: StrapiAdapter

Adapts Strapi-specific APIs to the generic ApiClient.

Remarks​

This adapter does not dynamically fetch content types since a prebuild script already generates the static TS interfaces for Strapi. It simply creates an ApiClient configured for Strapi.

Implements​

Constructors​

new StrapiAdapter()​

new StrapiAdapter(apiUrl, token?, logLevel?): StrapiAdapter

Creates an instance of StrapiAdapter.

Parameters​

apiUrl​

string

The base URL for the Strapi API.

token?​

string

Optional authentication token.

logLevel?​

Optional logging level (default: 'none')

"none" | "basic" | "detailed"

Returns​

StrapiAdapter

Methods​

createClient()​

createClient(schema, logger?): ApiClient

Creates a configured ApiClient for Strapi.

Parameters​

schema​

Schema

The schema (not used in this static implementation).

logger?​

LoggerInterface

Optional logger instance to inject into the client.

Returns​

ApiClient

The configured ApiClient.

Implementation of​

BackendAdapter.createClient


getSchema()​

getSchema(): Schema

Retrieves a static schema.

Returns​

Schema

A Schema instance.

Remarks​

Since the static type definitions are generated at build time, this implementation returns a new Schema instance. The actual type safety comes from the generated TypeScript definitions.

Implementation of​

BackendAdapter.getSchema