Request Context Object

The Request Context object is sent with every request. It contains information about who made the request, and which site and which external collection configuration made the request. Use the member_id in the request context object to implement permissions in your adapter.

Settings

The contents of the settings object are static and set in the Configuration section when setting up the external collection. Use the settings object to carry any static data you want to send to the adapter from your site. The prototype adaptor uses the settings object to receive the secretKey for authentication. Add attributes to the settings object to support any functionality you want to implement in your adapter.

instance_id

The instance_id is a UUID that uniquely identifies the Wix site that is making the request. You can create an external database collection in more than one Wix site that points to the same adaptor and external database. Use the instance_id to control access to your date on a per-site basis.

installation_id

The installation_id is a UUID that uniquely identifies the external collection configuration within your site. You can create more than one external collection in the same site that points to the same adaptor and external database. Each of these external collections will be identified by its own UUID, allowing you to implement different functionality and permissions for each one.

member_id

The member_id identifies the site visitor making the request. When creating new items, the Wix data backend populates the _owner attribute with the member_id. If the visitor is not a logged-in member, the member_id is based on a browser cookie and therefore consistent between sessions. The member_id will be null if the code that made the request was triggered by a backend process. Use member_id to filter data by user and to implement permissions in your adapter.

member_role

The member_role describes the role of the site visitor making the request. If the request is made by backend code and the find() function uses the suppressAuth option, the member_role will be set to BACKEND_CODE and the member_id will be null. In all other cases where backend code makes the request, the member_role will be set to VISITOR and the member_id will be null.

Did this help?