Skip to main content

Access control — require login

Redirect visitors who haven’t purchased to a sales page:

Promo code from URL

Check for a promo query parameter and set discount variables:

Geo-based redirect

Redirect mobile visitors to a mobile-optimized page:

Product-aware logic

Check if a product exists and set variables based on its properties:

Returning customer detection

Check order history and personalize the page:

Course access gate

Only allow access if the visitor has purchased the course product:

JSON API endpoint

Use a page as a lightweight JSON API:

Blog listing with backend logic

Fetch blog articles and inject them as template variables:

Product catalog with savings badges

Course access with session items

Share state between backend scripts and template-engine expressions:

Whitelist admin visitors

Shared auth guard with imports

Create a backend script module (code: auth) with reusable access-control helpers:
Then use it on any page — no need to duplicate the logic:
You can also build a shared utility module (code: utils):
See Imports for the full reference on import / export syntax and resolution rules.

External API with proxy

Verify a token with an external service (requires HTTP proxy to be configured):