Skip to content

Portal API ​

The Portal API lets you connect your own website pages to Appfactory Studio. With a few lines of code on a page, you can take payments, show a store, list events, sign people up to a mailing list, show notifications, book appointments, record analytics and display forms you built in the dashboard.

What it is ​

The Portal API is a script that you add to your page. Once it loads, your page has one object called Portal. Each part of Appfactory Studio is a property of it:

PartWhat it does
Portal.directPaymentsOne-off payments and subscriptions
Portal.commerceProducts, cart and checkout for an online store
Portal.eventsEvent listings, tickets and registration
Portal.subscribersMailing-list sign-up
Portal.notificationsA signed-in user's inbox
Portal.appointmentsBooking services and time slots
Portal.analyticsPage views and custom events
Portal.formsForms built in the dashboard

Adding it to your page ​

Add this script tag to your HTML:

html
<script src="https://api.appfactory.studio/sdk.js"></script>

Then tell it which site to talk to. Your site key is shown at the top of the dashboard's Settings page.

html
<script>
  window.Portal.url_key = 'YOUR_SITE_KEY';
</script>

TIP

Set the site key before your page makes its first call.

Where to go next ​

Each page below documents every method and property of one part, in alphabetical order, with its parameters, return values, related types and examples.

PageAccess
AnalyticsPortal.analytics
AppointmentsPortal.appointments
BrainPortal.brain
ChatPortal.chat
CommercePortal.commerce
Direct PaymentsPortal.directPayments
DocumentsPortal.documents
EventsPortal.events
FeedbackPortal.feedback
FormsPortal.forms
ListingsPortal.listings
Mail HandlerPortal.mailHandler
NotificationsPortal.notifications
Portal Objectwindow.Portal
ProcessorsPortal.processors
Site UsersPortal.siteUsers
SubscribersPortal.subscribers
UIPortal.ui