For the complete documentation index, see llms.txt. This page is also available as Markdown.

Class: FirmhouseClient

Client for accessing Firmhouse GraphQL api

Example

import { FirmhouseClient, Access } from '@firmhouse/sdk';
const client = new FirmhouseClient({
 apiToken,
 accessType: Access.write
});

const cart = await client.carts.getOrCreate();
const products = await client.products.fetchAll();
const invoices = await client.invoices.fetchAll();

Type Parameters

TAccess

TAccess extends Access = storefront

Access type. (Will be inferred from the config)

Properties

Property
Modifier
Type

config

readonly

Methods

rawRequest()

Sends an authenticated raw request to API. This can be used for custom field selections or bulk queries/mutations.

Parameters

graphQLQuery

string

The GraphQL query

variables?

Record<string, unknown>

Variables to use in query

Returns

Promise<unknown>

The response from the API

Throws

Resources

Resources for accessing Firmhouse API

Available with Storefront Access

carts

Get Signature

Cart methods

Returns

Carts


plans

Get Signature

Plan methods

Example

Returns

Plans


products

Get Signature

Product methods

Example

Returns

Products


selfServiceCenterToken

Get Signature

SelfServiceCenterToken methods

Returns

SelfServiceCenterToken

Only Available with Storefront Access

payments

Get Signature

Checkout payment methods

Example

Returns

TAccess extends storefront ? Payments : never

Only Available with Write Access

invoices

Get Signature

Invoice methods

Returns

TAccess extends write ? Invoices : never


projects

Get Signature

Project methods

Returns

TAccess extends write ? Projects : never


subscriptions

Get Signature

Subscription methods.

Returns

TAccess extends write ? Subscriptions : never

Last updated

Was this helpful?