Frontity Docs
  • ยป Welcome to Frontity
  • ๐Ÿš€Getting started
    • Quick start guide
  • ๐Ÿ“ƒAbout Frontity
    • Frontity features
    • Browser support
    • Get involved
  • ๐Ÿ“šCore Concepts
    • 1. Project
    • 2. Settings
    • 3. Packages
    • 4. Roots
    • 5. State
    • 6. Actions
    • 7. Libraries
    • 8. Namespaces
    • 9. Styles
  • ๐Ÿ—๏ธArchitecture
    • Decoupled Mode
    • Embedded Mode
  • ๐ŸŒŽDeployment
    • Deploy Frontity using Vercel
    • Deploy Frontity on Layer0
    • Deploy Frontity on Heroku
  • ๐ŸŒ—Isomorphic React
  • โšก๏ธ Perfomance
    • Caching
    • Link prefetching
    • Lazy Loading
    • Code Splitting
  • ๐Ÿ”ŽSEO
  • ๐Ÿ“–Guides
    • Setting the URL of the WordPress data source
    • Using Environment Variables in a Frontity project
    • WordPress requirements for Frontity
    • URLs in a Migration from WordPress to Frontity Decoupled Mode
    • Frontity Query Options
    • Redirections with Frontity
    • Understanding a Frontity project
    • Add a new Frontity package or theme to your project
    • How to share your Frontity project
    • Understanding Mars Theme
    • Working with processors
    • How to process page-builder content in Frontity
    • Keep Frontity Updated
    • Troubleshooting
    • JavaScript
    • React
  • ๐Ÿ‘Contributing
    • How to contribute?
    • Contributing Guide
Powered by GitBook
On this page

Was this helpful?

  1. Guides

Frontity Query Options

PreviousURLs in a Migration from WordPress to Frontity Decoupled ModeNextRedirections with Frontity

Last updated 4 years ago

Was this helpful?

"Frontity Query Options" are query string parameters added to the URL that start with frontity_.

For example:

https://example.com/my_post?frontity_name=Site-name

Any query parameter in the URL that starts with frontity_ is a "Frontity Query Option".

They can be used to dynamically configure certain options in the Frontity state.

It is important to note that Frontity Query Options do not form part of the canonical link. This means that whatever is passed in the frontity_ query parameter will not be matched by handlers or used to fetch data from WordPress. Its purpose is merely to allow dynamic configuration of Frontity.

Query string parameters that start with frontity_ are reserved to send special information to Frontity, i.e. they are not related to the URL that needs to be rendered (e.g. a post or a page), but instead are used to change the Frontity configuration dynamically.

These parameters are removed from state.frontity.initialLink and state.router.link because they should not affect the content of what needs to be rendered such as a post or a page.

If Frontity Query Option parameters are present in the URL then they are added to state.frontity.options, and the properties are then available to any packages that need them.

Note that the key names of parameters are camelCased when they are added to state.frontity.options. So, for example, the frontity_source_auth query string param will become state.frontity.options.sourceAuth once added.

Only key names are transformed in this way, values remain unchanged.

Some "Frontity Query Options" are used by , such as:

  • frontity_name -> state.frontity.options.name: The name of the site you want to load.

Note that the frontity_name setting is used only in development and only in .

However packages can also make use of them, for example:

  • frontity_source_auth -> state.frontity.options.sourceAuth: An authentication token for the .

Currently these are the only Frontity Query Options that Frontity itself uses but it's intended that more will be added in the future. However, you can also add your own Frontity Query Options if you want to use them in your package or theme.

Please note: Frontity Query Options should be treated as untrusted user input and should never ever be passed as parameters to arbitrary functions.

๐Ÿ“–
@frontity/core
Frontity multisite
source package