@pnp/graph/invitations¶
The ability invite an external user via the invitation manager
IInvitations¶
Scenario | Import Statement |
---|---|
Selective | import { graph } from "@pnp/graph"; import "@pnp/graph/invitations"; |
Preset: All | import "@pnp/graph/presets/all"; |
Create Invitation¶
Using the invitations.create() you can create an Invitation. We need the email address of the user being invited and the URL user should be redirected to once the invitation is redeemed (redirect URL).
import { graph } from "@pnp/graph";
import "@pnp/graph/invitations"
const invitationResult = await graph.invitations.create('external.user@email-address.com', 'https://tenant.sharepoint.com/sites/redirecturi');