To use the SiteInvites API, install the @wix/user-management
package using npm or Yarn:
or
Then import { siteInvites }
from @wix/user-management
:
This article shares some typical use cases you can support, as well as an example flow that supports each use case. You're certainly not limited to these use cases, but they can be a helpful jumping off point as you plan your implementation.
If your company creates Wix sites before handing them over to customers, you can invite the relevant customers to manage their sites once the site design and setup are complete.
inviteId
returned from the Bulk Invite call.inviteId
returned from the Bulk Invite call.This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates and sends emails inviting potential site contributors to become contributors in the requesting site.
Important: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.
Role IDs, referred to as policy IDs, to assign to the contributors.
Filter options.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Resends the email invitation to a potential site contributor.
Important: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.
Invite ID.
Filter options.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Revokes a pending site contributor invite.
Important: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.
function revokeInvite(inviteId: string): Promise<void>;
Invite ID.
import { createClient, ApiKeyStrategy } from "@wix/sdk";
import { siteInvites } from "@wix/user-management";
const wixClient = createClient({
modules: { siteInvites },
auth: ApiKeyStrategy({
siteId: "MY-SITE-ID",
apiKey: "MY-API-KEY",
}),
});
async function revokeInvite(inviteId) {
const response = await siteInvites.revokeInvite(inviteId);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.