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
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
NotFoundError - When there is an entity not found error in the response
ValidationError - When there are invalid fields
ServerError - When the request fails
Resources
Resources for accessing Firmhouse API
Available with Storefront Access
carts
Get Signature
Cart methods
Returns
plans
Get Signature
Plan methods
Example
Returns
products
Get Signature
Product methods
Example
Returns
selfServiceCenterToken
Get Signature
SelfServiceCenterToken methods
Returns
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?