In a custom element for a self-hosted site widget or site plugin, you need to use a Wix Client to call Wix APIs using the SDK.
You need provide Wix with a function that injects your client with the access token:
With this setup, Wix injects your client with an access token and you can use your client to call SDK methods.
The following example uses an authenticated client to call:
products.queryProducts
from the @wix/stores
backend moduleseo.title
from the @wix/site-seo
frontend module