SazitoSazito SDKv1.2.2
API Reference

Client

SazitoClient construction, lifecycle controls, and module access.

Factory

import { createSazitoClient } from '@sazito/client-sdk';

const client = createSazitoClient({
  domain: 'mystore.sazito.com',
});

createSazitoClient(config) input

FieldTypeRequiredDescription
domainstringRequiredStore domain without protocol.
timeoutnumberOptionalGlobal request timeout.
retryRetryConfigOptionalRetry policy for 5xx responses.
cacheRecord<string, CacheConfig>OptionalModule-level cache policy.
customFetchApitypeof fetchOptionalCustom fetch implementation.
debugbooleanOptionalSDK debug logs.

Lifecycle methods

Set Auth Token

Use: setAuthToken(token: string): void.

ParameterTypeRequiredDescription
tokenstringRequiredRaw JWT token stored in browser storage.

Get Auth Token

Use: getAuthToken(): string | null.

Returns currently stored token.

Clear Auth

Use: clearAuth(): void.

Removes persisted auth token.

Is Authenticated

Use: isAuthenticated(): boolean.

Returns true when token exists.

Clear Cache

Use: clearCache(): void.

Clears SDK cache.

Clear Credentials

Use: clearCredentials(): void.

Clears guest checkout credentials.

Clear All

Use: clearAll(): void.

Clears auth token, cache, and credentials.

Modules

Checkout and sales flow modules

ModulePurpose
cartStart checkout for guest or authenticated users, add/update/remove line items, and persist cart credentials.
invoicesBuild checkout invoice from cart, attach shipping address/method, apply discount/credit, and prepare payment state.
shippingCreate/update buyer address and read shipping method catalog used during checkout.
paymentsFetch payment methods, create payment, handle redirect/upload/code steps (including card-to-card), and finalize checkout.
ordersRead authenticated order history and order details after checkout.
usersAuthenticate users and merge guest checkout data into account context when needed.

Catalog and storefront modules

ModulePurpose
productsProduct listings, details, and product-centric discovery.
categoriesCategory tree and category pages.
searchKeyword/product search and discovery filtering support.
menuStore navigation/menu structures.
entityRoutesResolve slugs/routes to entity metadata.
imagesImage retrieval helpers for media-heavy views.
cmsCMS pages/blocks content for storefront pages.
generalStore-wide metadata and shop configuration.

Engagement and supporting modules

ModulePurpose
feedbacksProduct/shop feedback and review operations.
walletWallet balance and wallet transaction APIs (including checkout credit).
visitsVisit analytics/reporting endpoints.
bookingBooking-related retrieval for schedulable offerings.
dynamicFormsDynamic form schema and form-related checkout/product inputs.
regionsRegions/cities lookup used by shipping and address forms.

Direct module factory exports

You can import module factories directly from the package root when you do not need a full client instance.

import { products, categories, cart, invoices } from '@sazito/client-sdk';

const productsApi = products({ domain: 'mystore.sazito.com' });
const categoriesApi = categories({ domain: 'mystore.sazito.com' });
const cartApi = cart({ domain: 'mystore.sazito.com' });
const invoicesApi = invoices({ domain: 'mystore.sazito.com' });

All available aliases: products, categories, cart, orders, invoices, shipping, payments, users, search, feedbacks, wallet, cms, images, visits, booking, dynamicForms, regions, entityRoutes, menu, general.

Type Details

The following tables are generated from SDK TypeScript types and include nested object fields.

SazitoConfig

Source: src/core/config.ts

FieldTypeRequired
domainstringRequired
timeoutnumberOptional
retryRetryConfigOptional
cache{ products?: CacheConfig; categories?: CacheConfig; cart?: CacheConfig; orders?: CacheConfig; search?: CacheConfig; cms?: CacheConfig; tags?: CacheConfig; entityRoutes?: CacheConfig; }Optional
cache.productsCacheConfigOptional
cache.categoriesCacheConfigOptional
cache.cartCacheConfigOptional
cache.ordersCacheConfigOptional
cache.searchCacheConfigOptional
cache.cmsCacheConfigOptional
cache.tagsCacheConfigOptional
cache.entityRoutesCacheConfigOptional
customFetchApitypeof fetchOptional
debugbooleanOptional

RetryConfig

Source: src/core/config.ts

FieldTypeRequired
enabledbooleanRequired
retriesnumberRequired
retryDelaynumberRequired

CacheConfig

Source: src/core/config.ts

FieldTypeRequired
enabledbooleanRequired
ttlnumberOptional

On this page