About Sites
Create, inspect, edit, and delete Sites in the Contextual console.
Create, edit, and delete Sites in the Contextual console.
How Sites Work
A Site holds the application's identity and optional authentication configuration. Its source code and deployment are managed separately; see Parts of a Site.
Creating a Site does not start a running application. To serve it, configure a Site Worker with the Site ID and application image.
Saving changes to a Site creates a new configuration version. How a running Site Worker picks up those changes depends on whether its Site binding is pinned to a version.
An Auth Profile is optional. When a Site references one, the Site Worker validates sessions and resolves Site Users associated with that profile. The application controls which routes require sign-in and what each user may access. Without an Auth Profile, the standard runtime does not require users to sign in.
Create a Site
- Open Sites and select Create.
- Enter the ID and Name.
- Select the Auth Profile that the running Site should use. Leave it unset for a public Site that does not use Site authentication.
- If you use BYO Stytch and have a separate profile for local development, select it under Test Auth Profile.
- Create the Site, then open it and verify its saved settings.
Keep the Site ID for the Site Worker's SITE_ID option. You can bring your own application image or initialize the Astro starter from the saved Site.
Edit a Site
- Open Sites and select the Site in the intended tenant.
- Open its edit form.
- Update Name, Auth Profile, or Test Auth Profile as needed. ID is read-only.
- Save the changes and verify the saved values.
- Complete the follow-up action for the setting you changed:
| Change | Follow-Up Action |
|---|---|
| Change Name. | Check the display name in the console. |
| Add, replace, or remove Auth Profile. | Follow Apply Site Configuration Changes for the Worker binding, Managed Stytch origin registration, and hosted access checks. Removing the profile removes the standard runtime sign-in requirement after the new configuration loads. |
| Change Test Auth Profile. | Follow Configure BYO Stytch for Production and Local Development to copy the intended profile's configuration into site-auth.local.json, which Git ignores, and test it. Saving the selection does not configure your local server. |
When changing from BYO Stytch to Managed Stytch, or removing the primary profile, the edit form clears the separate Test Auth Profile selection. Review the saved authentication settings after this change.
To deploy application code, build a new application image and update the Site Worker. See Deploy and Update. Editing the Site does not change the Worker's image.
Apply Site Configuration Changes
A hosted Site Worker reads its Site and authentication configuration at startup and refreshes it about every minute. The SITE_ID option controls which Site configuration it reads:
| Site Binding | How Site Changes Apply |
|---|---|
An unpinned ID, such as SITE_ID=my-site |
Follows the latest saved Site record. Changes such as selecting a different Auth Profile are picked up on refresh. |
An ID pinned to a version, such as SITE_ID=my-site#<version> |
Keeps that saved Site version. To apply Site edits, update the Worker's binding to the new Site version or use an unpinned ID. |
The referenced Auth Profile's settings refresh about every minute in either case, including when the Site version is pinned.
If you add Managed Stytch to a running Site that had no authentication, or switch it from BYO to Managed Stytch, restart or update each Worker serving the changed Site version. This registers its browser origins and sign-in redirects with Managed Stytch. After any hosted authentication change, allow time for the configuration to load, then verify sign-in, sign-out, and access to protected routes at the Worker URL and any custom domain.
Local development with the Astro application uses site-auth.local.json instead. Follow Use an Auth Profile During Local Development to refresh that file.
Delete a Site
Open Sites, select the Site in the intended tenant, and delete it from the console. Verify that you are removing the intended Site record before confirming. GitHub repositories stay in place when you delete a Site, including repositories created for older Sites.