Sign-in and access
Sign in to your account
What this is- Open the Simple Host sign-in screen in your browser.
- Use a sign-in method offered on this screen: choose a provider, enter your email and its code, or fill in Email or username and Password when shown. Keep codes and passwords in the sign-in screen, outside chat.
- Check the signed-in account before changing a site’s access.
Create a key for a client
What this is-
Open the key controls.
On your sites page, open Settings, then Keys. Enter a name, select Deploy only for CI if appropriate, and press Create key.With an existing account key, sendPOST /v1/me/keyswith{"name":"laptop"}. UseGET /v1/me/keysto list keys, andDELETE /v1/me/keys/{id}to revoke one. -
Copy the new key when shown and store it locally. Send it in
X-API-Keyfrom your trusted client, never in a hosted page.
Sign visitors in on a page
What this is- Load
https://simple-host.app/auth.jswithoutdefer. Add a#sh-authelement and callSH.mount('#sh-auth'). - Call
await SH.requireSignIn()when the visitor presses a button that needs sign-in. - Read
await SH.me()before showing account details. CallSH.signOut()for the sign-out action. - On a custom domain, set
window.SH_CONFIG = {site:'your-site'}before loading the script.
Choose who can open a site
What this is- In the site’s Manage menu, choose Who can open.
- For named people, add their exact email addresses. Through the API, use
POST /v1/sites/{sitename}/viewerswith{"emails":["person@example.com"]}. - For a shared passcode, use the site’s Passcode controls in the dashboard. Keep the passcode out of chat.
- Confirm before removing either restriction. Use named viewers or a passcode, not both; do not use Unlisted as an access lock.
Errors you may see
| Code | Means | Do this |
|---|---|---|
missing_api_key (401) |
Owner API key missing | Send X-API-Key |
sign_in_required (401) |
Visitor session required | Sign in on the site |
account_auth_unavailable (403) |
Account sign-in on a site address | Use the platform sign-in screen |
use_custom_domain (400) |
Visitor sign-in needs its own origin | Open the site address |