Web method extensions allow you to define functions in your app's backend that you can call from your frontend code.
You can import web methods into frontend files as you would any other function in your project. Wix handles the communication between your frontend and backend under the hood.
You can add a web method extension using the Wix CLI.
Web methods allow you to specify the permissions required to call the function from the frontend.
Permission types:
Permissions.Anyone
: Any site visitor can call the function.Permissions.Admin
: Only site admins can call the function.Permissions.SiteMember
: Only site members can call the function.These are versions of the site visitor and site member identity types.
Be careful when selecting a permission, as exposing a function with the wrong permissions can create security risks.
Web methods provide several advantages over using http functions to call your app's backend: