I am trying to set up a CRM solution using SharePoint and Office 365, i want to get all the user details from graph api, how do i achieve it using @pnp/js. We were using an office 365 crm before, which had this specific feature that allowed to view all the users from the solution, so im trying to develop something like that. Can anyone help me on this?
1 Answer
There is @pnp/graph/users could be used with SPFx solution.
https://pnp.github.io/pnpjs/graph/users/
import { graph } from "@pnp/graph";
import "@pnp/graph/users";
const matchingUser = await graph.users.getById('[email protected]')();
Configure the API permissions requests
Install the libraries in SPFx project.
npm install @pnp/logging @pnp/common @pnp/odata @pnp/graph --save