Sign-in and access
Sign in to your account
What this is- Open the Simple Hack 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.
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.For a team key, use Website, Advanced: command line and API key. For a replacement account key, use Account, Danger zone, New key; confirm the old key will stop working.
-
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-hack.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.
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 |
Next
Every open site can be found by search engines, whatever List on my profile says. New sites start off. To keep a site out of search engines, use a passcode or named viewers, take it offline, or ship your own robots.txt / noindex.