Skip to content
On this page and tools

Hosted sites

Keeping keys safe on a hosted site

Your site can take payments, send email, show a map or ask an AI model a question without a single key sitting in a page. Save the key once in your dashboard. Bynefit keeps it encrypted and adds it to the request on its own servers, so no visitor can ever read it.

Available
Anything in a page is public. A hosted site is files that every visitor downloads: HTML, JavaScript, config.json. A key pasted into any of them can be copied by anyone who opens the page, and by every bot that crawls it.

Where to set it up

Open your site in the dashboard, then Settings and Keys & secrets. Managers and admins of the Space can add secrets, delete them and build secure requests, with no request to Bynefit. Only a Space admin chooses where a secret may be sent, and once a secret has somewhere to go, only an admin can replace its value. Every change is written to the Space's activity log. Adding, replacing or deleting a secret, and pointing a secure request or form webhook at a new address, is also emailed to the Space's admins and managers. The email names the secret, never its value.

Secret or public setting?

SecretPublic setting
Use it forPayment, email, AI, database and service keys; webhook signing secrets; passwordsThings that are fine to show: a map key locked to your site's address, a publishable payment key, a support email
Who can read itNobody can view the value once it is saved: not the person who saved it, not other managers or admins, not Bynefit staff. Managers can replace a secret that is not yet sent anywhere; after an admin names its destinations, only an admin can.Anyone visiting your site
How your site uses itBynefit adds it on the server, in a secure request or a form webhookYour page reads it from config.json
Who can use itOnly the destinations a Space admin named for it. Managers and admins can build secure requests and form webhooks that send it to one of those destinations, and nowhere else.Any page on your site
Limits50 per site, up to 8 KB each (room for a private key file)50 per site, up to 1,000 characters each

Names use capital letters, numbers and underscores, starting with a letter, like STRIPE_SECRET_KEY. Names starting with BYNEFIT_ or BYNLI_ are kept for Bynefit. A Space admin names where each secret may be sent: a host such as api.stripe.com, or a host and path such as hooks.slack.com/services/T123/B456/, which then matches only addresses under that path. A secret saved by a manager has no destinations and is sent nowhere until an admin adds one. Every change to the list is emailed to the Space's admins and managers. Never allow a shared webhook host on its own, such as hooks.slack.com or hooks.zapier.com: anyone can create an address there and receive your key. Always add the path of your own hook. A short value or a common word is accepted with a warning: it is easy to guess, and too common to reliably keep out of pages and answers. The list shows each secret's name, the last four characters for a long value (or a short fingerprint), when it was added or replaced and by whom, and when it was last used. If what you type into a public setting looks like a secret key, it is refused and you are pointed to Secrets instead.

Reading a public setting from a page

Public settings are saved into your site's config.json under public. The runtime has already fetched that file, so the browser answers from its cache.

JavaScriptyour page
const config = await fetch('/config.json').then((r) => r.json());
const mapsKey = config.public.MAPS_BROWSER_KEY;

Secure requests

A secure request is a named, fixed route from your page to one outside service. Your page calls a Bynefit address; Bynefit adds your secret and forwards the call. You choose the service's address, the methods it accepts, the headers to add, and whether the page may add a path or a query string.

Request
Method and pathGET /api/sites/my-site/proxy/weather?city=Atlanta
NeedsNothing from the page. It must be called from a page on the site itself.
In the dashboarda secure request named weather
Service address   https://api.example.com/v1/forecast?key={{secret:WEATHER_KEY}}
Methods           GET
Pass the query    on
JavaScriptyour page
const res = await fetch('https://bynefit.com/api/sites/my-site/proxy/weather?city=Atlanta');
const forecast = await res.json();

Put {{secret:NAME}} anywhere in the address after the host, or in a header such as Authorization: Bearer {{secret:NAME}}.

What keeps it safe

A secure request is not a sign-in. Anyone who can open your site can make the calls your page makes. Prefer services and keys that can only do what your page needs, and keep the daily limit close to what you expect.

Answers

StatuserrorMeans
The service's own statusThe call went through. The body is the service's answer, with your secrets redacted.
403origin_required, origin_not_allowedThe call did not come from a page on your site.
404not_foundNo secure request with that name, or the site is not live.
405, 400, 413, 415method_not_allowed, path_not_allowed, body_too_large, type_not_allowedThe page asked for something the secure request does not allow.
429rate_limited, quota_exceededOver one of your limits. Retry-After says when to try again.
502, 504upstream_*The service could not be reached, redirected, answered too much, or took too long.
503not_configuredA secret it uses is missing. The dashboard shows the last outcome of every secure request.

Form webhooks

A form webhook sends each answer from a form on your site to a service you choose, with your secret added on the server. Pick one form or every form on the site. With no message template, Bynefit posts every answer as JSON:

POST to your addressJSON
{
  "event": "form.submitted",
  "site": "my-site",
  "form": { "id": "frm_abc123", "name": "Contact" },
  "submission": { "id": "sub_9f2c...", "submitted_at": "2026-10-10T18:04:00+00:00" },
  "fields": { "Name": "Ana Ruiz", "Email": "ana@example.org" }
}

Or write your own message. This one posts to a chat channel whose address is itself a secret:

In the dashboarda form webhook
Send to   https://hooks.example.com/services/{{secret:CHAT_HOOK_PATH}}
Message   {"text": "New message from {{field:Name}}: {{field:Message}}"}

A template can use {{field:Label}}, {{form.name}}, {{form.id}}, {{submission.id}}, {{submission.time}}, {{site}} and {{secret:NAME}}, and must be valid JSON. What a visitor types is filled in once and never read as a placeholder, so typing {{secret:...}} into a form cannot reveal anything. Up to five form webhooks per site. Each waits up to 5 seconds and is not retried; the dashboard shows whether the last one worked.

The check on every save

Each page, script and data file you save or upload is checked before it goes live. If it contains the value of one of your secrets, it is not published. That includes the value written as base64, URL-encoded, as hex, or split across two strings in JavaScript, and a value that reaches a page from a shared part of the site.

Keys that look private are caught too, even if you never saved them: payment secret keys, cloud access keys, code-hosting and chat tokens, AI and email service keys, Bynefit server keys, a private key block, and long random values assigned to names like secret, token or api_key. You see the line and the first few characters, never the whole key.

Images, video and fonts are not checked. A value shorter than 8 characters is too common to look for.

If a key leaked

  1. Get a new key from the service that issued it, and turn the old one off there. This is the only step that stops a leaked key from working. Deleting it from your page does not, because copies may already exist.
  2. Replace the secret on the Keys & secrets page with the new key (an admin, if the secret is already sent somewhere). The old value is overwritten, and secure requests and form webhooks use the new one straight away.
  3. Remove the old key from any page. When you save a secret whose value is already in one of your files, the dashboard tells you which.
  4. Check the Space's activity log for changes you do not recognise.

How it is stored

Not the same as other keys

KeyWhat it is for
Site secrets (this page)Your own keys for other services, used by your hosted site through Bynefit
Space API keysYour server reading Bynefit data. See Keys and review.
Site keys for WordPressA WordPress site reporting to Bynefit. See Site host API.

Never store a Bynefit API key as a site secret to call Bynefit from a page: secure requests cannot reach Bynefit's own addresses.