Skip to content
On this page and tools

Hosted sites

Hosted sites guide

What a site hosted by Bynefit can show, collect and read, how each piece signs in or does not need to, and what a site can never see. Written for the person building the site, and for the WordPress plugin.

To change a Bynefit-hosted site's files, from the file manager or with an AI agent, see Manage and edit a hosted site's files.

What a hosted site is

KindWhere it livesHow Bynefit gets onto the page
Bynefit-hosted siteyour-site.site.bynefit.com, or your own domain once it is verifiedThe Bynefit runtime script is added to every page automatically, just before </body>.
WordPress site with the Bynefit Connect pluginYour own WordPress, managed by Bynefit or connectedThe plugin reports to Bynefit with a signed key. Add the script tag below for the browser modules. See Site host API.
Any other websiteAnywhereAdd one script tag with your site's slug in data-team. See below.

Which key do I use?

There is no single key for a hosted site. Each job has the credential that fits it.

JobCredentialRuns whereReference
Show events, resources and media; take a form; count a visitNone. The site's slug in the address identifies the site, and these endpoints return a live site's content or accept a submission. A site that is not live, or that does not exist, gets the same answer, so nothing reveals which sites exist.The visitor's browserHosted sites API
Let a visitor sign in, then read their own engagements, documents and messagesThe visitor's own access token from Sign in with BynefitThe visitor's browserClient portal API
Read your forms, form answers, events, payments and tasksA Space API key (bapi_tk_)Your server onlyAuthentication
Hear about a form submission as it happensA webhook signing secretYour serverWebhooks
Report a WordPress site's health and visit countsA site key (bynli_sh_) and a signatureThe WordPress serverSite host API
Use your own key for another service: payments, email, maps, AIA site secret, saved under Settings, Keys & secretsBynefit's server, through a secure request or a form webhookKeeping keys safe on a hosted site
Never put a Space API key, a site key, a webhook secret or any other service's secret key in a page. Hosted pages run JavaScript the site owner wrote, plus whatever else is on the page. Anything in a page can be read by every visitor. Save the key as a site secret instead. Every save is checked, and a page carrying one of your secrets is not published.

The runtime

On a Bynefit-hosted site the runtime loads itself. It checks whether the site is live, suspended or in maintenance, reads the site's config.json, loads the modules you ask for, records a page view and shows the Bynefit badge unless the site's plan removes it. A suspended site shows an unavailable page; a site in maintenance shows its maintenance message. Until a site is published, and while it is suspended, the public endpoints (events, forms, media, blocks) answer as if it did not exist, while the status check still reports it so this page can show. See which sites answer.

Use it on another website

HTMLyour site
<script src="https://bynefit.com/sites/bynli.js" data-team="your-site-slug" async></script>

data-team is your site's slug: 3 to 100 lowercase letters, numbers and hyphens.

Modules

Turn a module on with data-bynli="name" on an element, with data-bynli-ui="a,b" on html or body, or by listing names under ui.load in config.json.

ModuleWhat it doesTalks to
formTurns a form into a Bynefit form. Add data-form-id="frm_..." from the form builder. On an empty container element it also draws the form.The form schema and submit endpoints
eventsLists upcoming or past events as cards, a list, or bare data. data-limit, data-scope, data-style.The events endpoint
widgetDrops in a ready-made block: data-widget-name="events" or "resources".The widget endpoint
donateA donate card or button with preset amounts. It sends the visitor to your Bynefit donation page.Nothing. It builds a link.
authSign in with Bynefit: buttons, a sign-in sheet, and attributes that show the signed-in person's name or picture.The sign-in server. See OAuth 2.0 / OpenID Connect.
chromeA header and footer from config.json. Mount points are data-bynli-header and data-bynli-footer.Nothing
modal, confirm, toast, lightboxDialogs, confirmations, notices and image galleries.Nothing

The site's config.json

A file at the root of the site, up to 32 KB. Only the keys below do anything.

config.jsonJSON
{
  "ui": { "load": ["form", "events", "auth"] },
  "chrome": {
    "header": { "brand": "Riverside Aid", "brandHref": "/", "links": [ { "label": "Get help", "href": "/help" } ] },
    "footer": { "legal": "Riverside Aid is a nonprofit." }
  },
  "auth": {
    "client_id": "site_0123456789abcdef01234567",
    "redirect_uri": "/auth/callback",
    "scopes": ["openid", "profile", "email"],
    "issuer": "default",
    "signup": true
  },
  "branding": { "show_powered_by": true }
}

What a hosted site can read and write

DataCan a page read it?How
Site status (live, suspended, maintenance)YesRuntime status, no credential
Upcoming and past events, with sold counts and limitsYesEvents endpoint or the events module, no credential. Only for a live site whose Space has turned on public events; cancelled and draft events are left out, and the window is two years either way.
Approved community resourcesYesThe resources widget, no credential
Media libraryYesMedia list, no credential
Form definitionsYesForm schema, no credential
Form submissions (what people typed)No. A page can submit one, never read them.Space owners read them in the dashboard. Your server can read them with a Space API key and the forms permission, or hear about each one by webhook.
Visitor analyticsNo. A page can send a page view, never read the totals.Dashboard
The signed-in person's own profileYesSign in, then the user-info endpoint. Only what they chose to share with this site.
The signed-in person's own engagements, documents, messages and bookingsYes, theirs onlyClient portal API
Other people's engagements, the member list, payments, donations, ticket buyersNoNot exposed to a page by any endpoint
Site health, updates, content counts (WordPress)No. The plugin sends them; the owner reads them in the Bynefit Sites app.Site host API

Engagements

Engagements are the orders and requests a practice runs through Bynefit: a company formation, a service, a booking. A hosted practice site can build a client portal on them, and these are the only ways to reach engagement data:

The practice needs the engagements add-on switched on. Without it the portal answers 403 with addon_required.

Forms and webhooks

A form submitted from a hosted site fires the form.submitted webhook with source set to team_site and the site's slug and id. The submission's answers are never inside the webhook. The envelope carries the form's id and name, and the id of the submission, so your server can fetch the answers with a Space API key. Every non-registration form submission also opens a follow-up task for your Space's leaders, capped at 20 a hour per Space. If the person gave an email address, they get a confirmation email, or your own autoresponder if the form has one.

To send the answers themselves to a service you use, add a form webhook under Keys & secrets. It posts each answer to your address, with your own secret added on Bynefit's server. See form webhooks.

Shop and products

Planned There is no public API for a hosted site's shop, products or orders yet. The WordPress plugin has its own private checkout hand-off, which is not documented here.

Security notes