Storeware Docs

createStorewareApp

One object for webhooks, installs, admin sessions and API clients.

import { ... } from '@storeware/plugin-sdk';

createStorewareApp

function createStorewareApp(options: StorewareAppOptions): StorewareApp

NotInstalledError

new NotInstalledError(storeId: string)

StorewareAppOptions

NameTypeDescription
clientIdstring
clientSecretstring
installationsInstallationStore
apiUrl?string
adminUrl?string
fetchImpl?typeof fetch

AdminContext

Who is looking at your app's page in the admin. installation is the record your store keeps, or for an app Storeware hosts, the HostedInstallation the runtime hands over.

NameTypeDescription
claimsExtensionSessionClaims
installationInstallation
clientStorewareClient

StorewareApp

NameTypeDescription
webhooksWebhookRouterMount at your manifest's [webhooks] url (and [privacy] url).
authenticateAdmin(request: Request) => Promise<AdminContext<Installation>>The person looking at your home or panel in the admin, proved by the session token on the request (?session= or Authorization: Bearer). The first time a shop opens your home, the session is traded for its tokens and secrets, which is the install.
verifyRequest<T = unknown>(request: Request, kind: Exclude<SignedRequestKind, 'webhook'>) => Promise<{ body: T; installation: Installation; }>A signed call from Storeware to a tool, knowledge or block endpoint, verified as that kind, with its body parsed. Read the body nowhere else.
clientFor(storeId: string) => Promise<StorewareClient>An API client for one shop. Its tokens rotate into the store.
installUrl(options?: { storeId?: string; }) => stringWhere to send a merchant to install your app from Storeware.

On this page