auth

The auth submodule allows you to work with Wix authentication and permissions.

Important:

This submodule is not intended for use with self-hosted Apps.

Import statement

Copy
1

Methods

elevate()

Receives an SDK function and returns an instance of the same function that runs with the authentication and permissions of the current app.

Use elevate() in frontend environments such as site or dashboard extensions when you need to make a call with Wix app authentication.

Learn more about elevated permissions.

Important:
  • Exposed elevated function calls create a security risk for privilege escalation attacks. Make sure to protect your exposed function calls with the appropriate logic.
  • This method can only be used in the code for an app's backend extensions.

Syntax

Copy
1

Parameters

NameTypeDescription
sourceFunctionfunctionSDK function to elevate.

Returns

An SDK function that runs with app-level permissions.

Example

Create a new product with elevated permissions:

Copy
1
Was this helpful?
Yes
No