Portal Object
The window.Portal object itself: one property per module, plus the settings that say which site the page talks to.
Quick start
window.Portal.url_key = 'abc123'; // which site this page talks to
const events = await window.Portal.events.events(); // then use any module
console.log(events.length);API reference
PortalDashboardRenderContext
What a section provider's render() receives.
connection
The connection being shown.
Type: PortalSiteUserConnection
const connection = dashboardRenderContext.connection;goTo()
Jump to another view, possibly in another group (a purchase's manage target).
dashboardRenderContext.goTo(moduleKey, instance, view, ref);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
moduleKey | string | Yes | — |
instance | string | null | Yes | — |
view | string | Yes | The view key. |
ref | string | No | A reference. |
ref
A record reference when the view is a detail screen.
Type: string
const ref = dashboardRenderContext.ref;refresh()
Re-render this view — e.g. after a cancel. Also refreshes the sidebar's badge counts.
await dashboardRenderContext.refresh();Returns
Resolves when the call has completed.
su
The page's Site Users client.
Type: PortalSiteUsersInstance
const su = dashboardRenderContext.su;user
The signed-in user.
Type: PortalSiteUserPublic
const user = dashboardRenderContext.user;view
The view key to paint.
Type: string
const view = dashboardRenderContext.view;PortalDashboardSectionProvider
A module's contribution to the account dashboard. Register it with Portal.ui.siteUsers.registerSectionProvider().
moduleKey
The module key this provider serves; matches PortalSiteUserConnection.module_key.
Type: string
const moduleKey = dashboardSectionProvider.moduleKey;render()
Paint one view into host. Owns its own fetches, its own empty state and its own errors — a throw here is caught by the shell and rendered as a retry notice inside the pane, never as a blank dashboard.
await dashboardSectionProvider.render(host, ctx);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
host | HTMLElement | Yes | Paint one view into host. |
ctx | PortalDashboardRenderContext | Yes | What a section provider's render() receives. |
Returns
Resolves when the call has completed.
views()
Which views this connection offers. Filter on connection.capabilities — never assume.
const dashboardViews = dashboardSectionProvider.views(connection);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
connection | PortalSiteUserConnection | Yes | A "connection" links a site user's account to one module instance (a store, an event...), so the account dashboard can show that module's data. |
Returns
Returns an array of PortalDashboardView.
PortalProcessorsAPIClient
Billing calls on Portal.processors (a provider-neutral API client).
configure()
Sets the API base URL (for pages on another origin).
processorsAPIClient.configure(options);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | Optional settings. |
options.baseUrl | string | No | — |
deletePaymentMethod()
Deletes a saved card.
const result = await processorsAPIClient.deletePaymentMethod(params);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
params | object | Yes | Extra options. |
params.processor_reference_num | string | Yes | The processor's reference number. |
params.customer_id | string | Yes | The customer's id at the provider. |
params.method_id | string | Yes | The saved payment method's id. |
Returns
Resolves with an object with these fields:
| Name | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | True when the call worked. |
message | string | No | A message to show the visitor. |
getPayments()
The customer's charges, subscription and saved cards.
const billingPaymentsResponse = await processorsAPIClient.getPayments(params);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
params | object | Yes | Extra options. |
params.processor_reference_num | string | Yes | The processor's reference number. |
params.customer_id | string | Yes | The customer's id at the provider. |
Returns
Resolves with a PortalBillingPaymentsResponse: The answer to Portal.processors.getPayments().
getPlans()
The subscription plans of the processor.
const result = await processorsAPIClient.getPlans();Returns
Resolves with an object with these fields:
| Name | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | True when the call worked. |
data | Array<Record<string, unknown>> | Yes | The data. |
getPublicConfig()
The processor's public settings (no secrets): provider, mode, publishable key, hosted or embedded, provider extras. No sign-in needed.
const result = await processorsAPIClient.getPublicConfig(processorReferenceNum);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
processorReferenceNum | string | Yes | — |
Returns
Resolves with an object with these fields:
| Name | Type | Required | Description |
|---|---|---|---|
reference_num | string | Yes | The record's reference number. |
provider | string | Yes | The provider's name. |
mode | string | Yes | — |
publishable_key | string | Yes | — |
use_hosted | boolean | Yes | True when the provider's hosted page is used. |
extra_config | Record<string, unknown> | Yes | — |
storePaymentMethod()
Saves a payment method to the customer (a Stripe payment method id, or a Square source id).
const result = await processorsAPIClient.storePaymentMethod(params);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
params | object | Yes | Extra options. |
params.processor_reference_num | string | Yes | The processor's reference number. |
params.customer_id | string | Yes | The customer's id at the provider. |
params.source_id | string | No | The card token from the provider's own SDK. |
params.payment_method_id | string | No | — |
Returns
Resolves with an object with these fields:
| Name | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | True when the call worked. |
message | string | No | A message to show the visitor. |
syncPayments()
Re-reads the customer's data from the provider.
const billingSyncResponse = await processorsAPIClient.syncPayments(params);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
params | object | Yes | Extra options. |
params.processor_reference_num | string | Yes | The processor's reference number. |
params.customer_id | string | Yes | The customer's id at the provider. |
Returns
Resolves with a PortalBillingSyncResponse: The answer to Portal.processors.syncPayments().
updatePaymentMethod()
Makes a saved card the default.
const result = await processorsAPIClient.updatePaymentMethod(params);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
params | object | Yes | Extra options. |
params.processor_reference_num | string | Yes | The processor's reference number. |
params.customer_id | string | Yes | The customer's id at the provider. |
params.method_id | string | Yes | The saved payment method's id. |
Returns
Resolves with an object with these fields:
| Name | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | True when the call worked. |
message | string | No | A message to show the visitor. |
PortalSiteUsersGateOptions
Options of Portal.ui.siteUsers.requireSignIn().
onGuest()
The visitor continues as a guest; only offered when the block allows guests.
const result = siteUsersGateOptions.onGuest();Returns
Returns void \| Promise<void>.
onSignedIn()
A session exists (already, or after the sign-in).
const result = siteUsersGateOptions.onSignedIn(user, su);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
user | PortalSiteUserPublic | Yes | A signed-in site user, as safe to show in the browser. |
su | PortalSiteUsersInstance | Yes | A Site Users client for one module: account sign-in, profile, saved cards, purchases. |
Returns
Returns void \| Promise<void>.
purpose
Heading copy: "Sign in <purpose>", for example "to complete your order".
Type: string
const purpose = siteUsersGateOptions.purpose;su
The page's own Site Users client; leave it out on a page served by the same site as the API.
Type: PortalSiteUsersInstance
const su = siteUsersGateOptions.su;processor
A provider-aware payment client (new Portal.processors.Client({ processorId })). It hides the difference between Stripe, Square and PayPal. Direct Payments drives it for you; use it directly only for custom flows.
confirmStripePayment()
Stripe: confirms the mounted payment.
const processorClientPaymentResult = await processor.confirmStripePayment(returnUrl, setupFutureUsage);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
returnUrl | string | Yes | Where the buyer is sent back to after the provider's own page. |
setupFutureUsage | boolean | No | Keep the card for later charges. |
Returns
Resolves with a PortalProcessorClientPaymentResult: The outcome of a payment or card-setup call.
confirmStripeSetup()
Stripe: confirms the mounted card setup.
const processorClientPaymentResult = await processor.confirmStripeSetup(returnUrl);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
returnUrl | string | Yes | Where the buyer is sent back to after the provider's own page. |
Returns
Resolves with a PortalProcessorClientPaymentResult: The outcome of a payment or card-setup call.
createPayment()
Mounts a payment form (or redirects to the hosted page) for a payment.
const processorClientPaymentResult = await processor.createPayment(opts);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
opts | PortalProcessorClientCheckoutOptions | Yes | The options of a payment or a card setup (createPayment, setupPaymentMethod, tokenizeSquareAndCharge). |
Returns
Resolves with a PortalProcessorClientPaymentResult: The outcome of a payment or card-setup call.
createSubscription()
Starts a subscription.
const processorClientSubscriptionResult = await processor.createSubscription(opts);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
opts | PortalProcessorClientSubscriptionOptions | Yes | Options of client.createSubscription(). |
Returns
Resolves with a PortalProcessorClientSubscriptionResult: The outcome of client.createSubscription() and the subscription:* events.
destroy()
Unmounts the form and releases the provider client.
processor.destroy();getConfig()
The public settings the client loaded in init(), or null before.
const result = processor.getConfig();Returns
Returns PortalProcessorClientConfig \| null.
init()
Loads the processor's settings and prepares the provider SDK. Call first.
await processor.init();Returns
Resolves when the call has completed.
onResult()
Registers a callback for the outcome of payments started through this client.
processor.onResult(callback);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
callback | (result: PortalProcessorClientPaymentResult) => void | Yes | The outcome of a payment or card-setup call. |
setupPaymentMethod()
Sets a payment method up for later use without charging now (Stripe SetupIntent).
const processorClientPaymentResult = await processor.setupPaymentMethod(opts);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
opts | PortalProcessorClientCheckoutOptions | Yes | The options of a payment or a card setup (createPayment, setupPaymentMethod, tokenizeSquareAndCharge). |
Returns
Resolves with a PortalProcessorClientPaymentResult: The outcome of a payment or card-setup call.
tokenizeSquare()
Square: tokenises the entered card without charging; resolves with the source_id.
const result = await processor.tokenizeSquare();Returns
Resolves with an object with these fields:
| Name | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | True when the call worked. |
source_id | string | No | The card token from the provider's own SDK. |
error | string | No | The reason, when it failed. |
tokenizeSquareAndCharge()
Square: tokenises the entered card and charges it.
const processorClientPaymentResult = await processor.tokenizeSquareAndCharge(opts);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
opts | PortalProcessorClientCheckoutOptions | Yes | The options of a payment or a card setup (createPayment, setupPaymentMethod, tokenizeSquareAndCharge). |
Returns
Resolves with a PortalProcessorClientPaymentResult: The outcome of a payment or card-setup call.
updatePaymentAmount()
Updates the amount of a mounted form before it is confirmed (Stripe deferred intents); false when the provider cannot.
const ok = await processor.updatePaymentAmount(amountCents);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
amountCents | number | Yes | An amount in cents. |
Returns
Resolves with a boolean.
window.Portal
The window.Portal object: one property per module.
analytics
Visitor analytics.
Type: PortalAnalyticsAPI
const analytics = window.Portal.analytics;appointments
Appointment booking.
Type: PortalAppointmentsAPI
const appointments = window.Portal.appointments;brain
A client of the Brain, for pages not served by a site.
Type: PortalBrainNamespace
const brain = window.Portal.brain;brain_url
For a page on another origin that talks to the Brain (no sites address, so no key): the Brain's https origin, for example https://www.appfactory.studio. Set it before the SDK runs; url_key wins when both are set.
Type: string
const brain_url = window.Portal.brain_url;chat
Live chat (visitor side).
Type: PortalChatNamespace
const chat = window.Portal.chat;commerce
Online store: create(storeRef) gives a client.
Type: PortalCommerceAPI
const commerce = window.Portal.commerce;directPayments
Payments and subscriptions: create(ref) gives a client.
Type: PortalDirectPaymentsFactory
const directPayments = window.Portal.directPayments;documents
File upload and management.
Type: PortalDocumentsNamespace
const documents = window.Portal.documents;events
Public events and ticketing.
Type: PortalEventsAPI
const events = window.Portal.events;feedback
Visitor feedback forms.
Type: PortalFeedbackAPI
const feedback = window.Portal.feedback;forms
Dashboard-built forms.
Type: PortalFormsAPI
const forms = window.Portal.forms;httpUrl
The origin every request goes to, built from url_key (https://<url_key>.sites.appfactory.studio); the page's own origin when there is no key. Read-only: assigning it is ignored.
Type: string (read-only)
const httpUrl = window.Portal.httpUrl;listings
Listings (cards, directories).
Type: PortalListingsAPI
const listings = window.Portal.listings;mailHandler
Send e-mail through a configured handler.
Type: PortalMailHandlerAPI
const mailHandler = window.Portal.mailHandler;notifications
Inbox notifications and notification rules.
Type: PortalNotificationsAPI
const notifications = window.Portal.notifications;processors
Payment provider clients (lower level than Direct Payments).
Type: PortalProcessorsNamespace
const processors = window.Portal.processors;siteUsers
Visitor accounts (sign-in, profile, saved cards, purchases).
Type: PortalSiteUsersNamespace
const siteUsers = window.Portal.siteUsers;subscribers
Newsletter / mailing-list sign-up.
Type: PortalSubscribersAPI
const subscribers = window.Portal.subscribers;ui
Reference UI blocks; present only when the separate UI bundle is loaded.
Type: PortalUiNamespace
const ui = window.Portal.ui;url_key
The site this page talks to: the <ref> of https://<ref>.sites.appfactory.studio (shown at the top of the dashboard's Settings). Set it once the SDK has loaded: window.Portal.url_key = '<ref>'. Empty on a site's own pages.
Type: string
const url_key = window.Portal.url_key;window.Portal.subscribers
Portal.subscribers — newsletter / mailing-list sign-up.
getCategories()
The lists a visitor can join.
const subscriberCategorySummarys = await window.Portal.subscribers.getCategories();Returns
Resolves with an array of PortalSubscriberCategorySummary.
subscribe()
Subscribes an address to one or more lists.
const subscriberSignupResponse = await window.Portal.subscribers.subscribe(payload);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
payload | PortalSubscriberSignupPayload | Yes | What Portal.subscribers.subscribe() sends: a newsletter sign-up. |
Returns
Resolves with a PortalSubscriberSignupResponse: The answer to Portal.subscribers.subscribe().
window.Portal.ui.ecommerce
Reference e-commerce UI (Portal.ui.ecommerce): self-mounting storefront blocks.
applyPrices()
Writes the prices of a (legacy) catalogue into the page under root.
window.Portal.ui.ecommerce.applyPrices(root, catalog);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
root | HTMLElement | Yes | Writes the prices of a (legacy) catalogue into the page under root. |
catalog | PortalUiPriceCatalog | Yes | The price list Portal.ui.ecommerce.applyPrices() paints into designed markup. |
install()
Mounts every matching root on the page; called once on load.
window.Portal.ui.ecommerce.install();mount()
Mounts one root yourself (for example one inserted after load).
await window.Portal.ui.ecommerce.mount(root);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
root | HTMLElement | Yes | The element to search inside. |
Returns
Resolves when the call has completed.
toast()
Shows a toast message; isError styles it as an error.
window.Portal.ui.ecommerce.toast(message, isError);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
message | string | Yes | A message to show the visitor. |
isError | boolean | No | Shows a toast message; isError styles it as an error. |
window.Portal.ui.events
A page-level module's reference UI — – install() self-mounts every matching root on the page (called once, on load); mount(root) is exposed for a consumer who wants to mount a root itself (e.g. one inserted after page load).
install()
Mounts every matching root on the page. Runs automatically on load.
window.Portal.ui.events.install();mount()
Mounts one root element.
await window.Portal.ui.events.mount(root);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
root | HTMLElement | Yes | The element to search inside. |
Returns
Resolves when the call has completed.
window.Portal.ui.siteUsers
Exposed on Portal.ui.siteUsers so a tenant with a bespoke module can contribute a Dashboard group from their own script tag.
Extends PortalUiModuleAPI.
registerSectionProvider()
Adds a section (a group of views) to the Site Users dashboard from your own module.
window.Portal.ui.siteUsers.registerSectionProvider(provider);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
provider | PortalDashboardSectionProvider | Yes | A module's contribution to the account dashboard. |
requireSignIn()
The sign-in gate. Renders the login form into host when nobody is signed in (with no "continue as guest" button when block.guest_checkout is false), or calls onSignedIn straight away when a session exists. Site Users does not know which module is asking: the module passes the site_users block from its own settings.
await window.Portal.ui.siteUsers.requireSignIn(host, block, options);Parameters
| Name | Type | Required | Description |
|---|---|---|---|
host | HTMLElement | Yes | Renders the login form into host when nobody is signed in (with no "continue as guest" button when block.guest_checkout is false), or calls onSignedIn straight away when a session exists. |
block | PortalSiteUsersBlock | Yes | The site_users block every connected instance's public config (a store, an event, an appointment calendar) carries. |
options | PortalSiteUsersGateOptions | Yes | Options of Portal.ui.siteUsers.requireSignIn(). |
Returns
Resolves when the call has completed.
Types
PortalApiError
The shape every commerce/events/appointments SDK method's rejection carries once a request fails. code ending in _E_AUTH_REQUIRED (or equal to SU_E_AUTH_REQUIRED) means the request needs a signed-in session belonging to module, when named.
Extends Error.
| Name | Type | Required | Description |
|---|---|---|---|
status | number | Yes | The HTTP status. |
code | string | No | A stable machine code, for example 'DP_E_NOT_RESUMABLE'. |
module | string | No | For auth-required errors: the Site Users module to sign in to. |
approvalUrl | string | No | Direct Payments: with DP_E_APPROVAL_REQUIRED, where the payer approves a plan change at the provider (PayPal). |
try {
await window.Portal.events.myRegistrations();
} catch (e) {
const err = e as PortalApiError;
if (err.code && err.code.endsWith('_E_AUTH_REQUIRED')) {
console.log('Sign in to Site Users module', err.module);
}
}PortalBillingPaymentMethodRecord
A saved card as the billing view lists it.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The method's id. |
cardNumber | string | Yes | Masked number. |
expiryDate | string | Yes | MM/YY. |
cardType | string | Yes | Brand. |
cardholderName | string | Yes | The cardholder's name. |
billingZip | string | No | The billing postcode. |
PortalBillingPaymentRecord
One charge of a customer, from Portal.processors.getPayments().
| Name | Type | Required | Description |
|---|---|---|---|
id | number | Yes | Record id. |
charge_id | string | Yes | The provider's charge id. |
amount_cents | number | Yes | Amount in cents. |
currency | string | Yes | ISO currency code. |
status | string | Yes | Payment status. |
provider | string | Yes | The provider's name. |
description | string | Yes | What was paid for. |
last4 | string | Yes | Last four digits of the card used. |
charged_at | string | Yes | ISO date charged. |
PortalBillingPaymentsResponse
The answer to Portal.processors.getPayments().
| Name | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | True when the call worked. |
charges | PortalBillingPaymentRecord[] | Yes | The customer's charges. |
subscription | PortalBillingSubscriptionRecord | No | The customer's subscription, if any. |
payment_methods | PortalBillingPaymentMethodRecord[] | No | The customer's saved cards. |
message | string | No | A message to show. |
PortalBillingSubscriptionRecord
A customer's subscription as the billing view lists it.
| Name | Type | Required | Description |
|---|---|---|---|
id | number | Yes | Record id. |
plan_id | string | Yes | The plan's id. |
status | string | Yes | Subscription status. |
current_period_end | string | Yes | ISO date the current period ends. |
discount_code | string | No | The discount code in use. |
default_payment_method_id | string | No | The saved card charged. |
plan | object | No | The plan's details. |
plan.name | string | Yes | The name. |
plan.plan_amount_cents | number | Yes | — |
plan.plan_interval | string | Yes | — |
plan.description | string | No | A description. |
PortalBillingSyncResponse
The answer to Portal.processors.syncPayments().
| Name | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | True when the call worked. |
message | string | No | A message to show. |
provider_raw_data | Record<string, unknown> | No | The provider's raw data, for debugging. |
PortalDashboardView
One view (sidebar entry / screen) a dashboard section provides.
| Name | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Stable within a group. Becomes data-su-nav="<module_key>:<instance|*>:<key>". |
label | string | Yes | Label of the sidebar button. |
icon | string | No | Icon name. |
navVisible | boolean | No | false: reachable by row click or deep link, never its own sidebar button. Default true. |
PortalProcessorClientCheckoutOptions
The options of a payment or a card setup (createPayment, setupPaymentMethod, tokenizeSquareAndCharge).
| Name | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Amount in the smallest currency unit (cents for USD). |
currency | string | No | ISO 4217 currency code. Default 'usd'. |
description | string | No | Shown on the provider's dashboard. |
email | string | No | The payer's e-mail. |
successUrl | string | No | Where to redirect after a successful hosted payment. |
cancelUrl | string | No | Where to redirect after a cancelled hosted payment. |
metadata | Record<string, string> | No | Extra key/value data stored with the payment. |
mountTarget | string | HTMLElement | No | CSS selector or element to mount the embedded payment form into. |
setup_future_usage | boolean | No | Stripe only: set the payment intent up for later off-session use (subscriptions). |
split_items | object[] | No | Stripe only: a marketplace split, one entry per seller line (the browser never needs a raw account id). |
split_items[].seller_reference_num | string | Yes | The seller's reference. |
split_items[].order_item_reference_num | string | Yes | The order item's reference. |
split_items[].line_net | number | Yes | The line's net amount. |
transfer_group | string | No | Required alongside split_items: must equal the order or invoice reference. |
PortalProcessorClientConfig
A processor's public settings, as loaded by client.init().
| Name | Type | Required | Description |
|---|---|---|---|
reference_num | string | Yes | The processor's reference. |
provider | 'stripe' | 'square' | 'paypal' | Yes | Which provider the processor uses. |
mode | 'sandbox' | 'live' | Yes | sandbox (test money) or live. |
publishable_key | string | Yes | The key the browser-side provider SDK uses; safe to expose. |
use_hosted | boolean | Yes | True when the provider's hosted page is used instead of an embedded form. |
extra_config | Record<string, string> | Yes | Provider-specific extra settings. |
PortalProcessorClientOptions
Options of new Portal.processors.Client().
| Name | Type | Required | Description |
|---|---|---|---|
processorId | string | Yes | The processor's reference. |
PortalProcessorClientSubscriptionOptions
Options of client.createSubscription().
| Name | Type | Required | Description |
|---|---|---|---|
email | string | No | The payer's e-mail. |
plan_id | string | Yes | The plan id configured for the processor. |
tier_ref | string | No | The Direct Payments tier being bought; the server then starts the subscription at that tier's price. |
interval | string | No | Which of the tier's prices to start on (month, year,...). Only read with tier_ref. |
discount_code | string | No | A discount code (check it first with resolveDiscount()). |
source_id | string | No | Square only: the nonce from the Square Web Payments SDK. |
invoice_reference_num | string | No | The invoice the subscription belongs to. |
metadata | Record<string, string> | No | Extra key/value data. |
mountTarget | string | HTMLElement | No | Where the payment form is mounted. |
PortalProcessorsNamespace
Portal.processors: billing calls plus the Client constructor.
Extends PortalProcessorsAPIClient.
| Name | Type | Required | Description |
|---|---|---|---|
Client | new (opts: PortalProcessorClientOptions) => PortalProcessorClientInstance | Yes | Construct a provider-aware processor client |
PortalSubscriberCategorySummary
A subscriber list (category) a visitor can join.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The category id; use it in category_ids. |
name | string | Yes | Display name. |
description | string | Yes | What the list is about. |
active | boolean | Yes | False when the list is closed to new sign-ups. |
subscribers_count | number | No | How many people are on the list, when the server reports it. |
PortalSubscriberSignupPayload
What Portal.subscribers.subscribe() sends: a newsletter sign-up.
| Name | Type | Required | Description |
|---|---|---|---|
email | string | Yes | The subscriber's e-mail address (required). |
name | string | No | The subscriber's name. |
phone | string | No | The subscriber's phone number. |
category_ids | string[] | No | The lists (categories) to join, by id. |
category_id | string | No | A single list to join; same as a one-item category_ids. |
PortalSubscriberSignupResponse
The answer to Portal.subscribers.subscribe().
| Name | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | True when the visitor was subscribed. |
subscriber | object | No | The stored subscriber. |
subscriber.id | string | Yes | The record's id. |
subscriber.email | string | Yes | An e-mail address. |
subscriber.name | string | No | The name. |
subscriber.phone | string | No | A phone number. |
subscriber.active | boolean | Yes | False until the address is confirmed, when double opt-in is on. |
hubspot_synced | boolean | No | True when the subscriber was also pushed to the connected CRM. |
message | string | No | A message to show the visitor. |
PortalUiNamespace
Portal.ui — the reference UI layer, loaded separately from the data SDK. Each member auto-mounts elements with the matching data-* attributes.
| Name | Type | Required | Description |
|---|---|---|---|
ecommerce | PortalUiEcommerceAPI | Yes | Storefront blocks. |
events | PortalUiModuleAPI | Yes | Event listing and registration blocks. |
appointments | PortalUiModuleAPI | Yes | Booking blocks. |
siteUsers | PortalUiSiteUsersAPI | Yes | Login, register and account dashboard blocks. |
notifications | PortalUiModuleAPI | Yes | Bell, inbox and per-event switches: [data-notifications-kind="bell"|"inbox"|"rules"] roots. |
feedback | PortalUiModuleAPI | Yes | The Feedback block: [data-feedback-kind="form"] roots. |
<div data-notifications-kind="bell"></div>
<script>if (window.Portal.ui) window.Portal.ui.notifications.install();</script>PortalUiPriceCatalog
The price list Portal.ui.ecommerce.applyPrices() paints into designed markup.
| Name | Type | Required | Description |
|---|---|---|---|
revision | number | No | Catalogue revision number. |
currency | string | No | ISO currency code. |
prices | object[] | No | One row per priced product. |
prices[].product_ref | string | Yes | — |
prices[].product_name | string | Yes | — |
prices[].slug | string | null | No | URL slug. |
prices[].variant_ref | string | null | No | — |
prices[].price_cents | number | Yes | Price in cents. |