Skip to content

Installation

  1. Download the latest SharePoint Framework packages pnp-modern-search-parts-v4.sppkg from the GitHub repository.
  2. Add pnp-modern-search-parts-v4.sppkg to the global tenant app catalog or a site collection app catalog. If you don't have an app catalog, follow this procedure to create one.

    "App Catalog "

    • The packages are deployed in the general Office 365 CDN meaning we don't host any code.

    • For the pnp-modern-search-parts-v4.sppkg package, you can choose to make the solution available in all sites or force to install an app to the site every time.

    • The solution asks the following API permissions by default to enhance the experience. These permissions are not mandatory. If you don't accept them, you will simply have less available features.

    • You can approve scopes from the API Access screen in the SharePoint Admin Center: https://<tenant>-admin.sharepoint.com/_layouts/15/online/AdminHome.aspx#/webApiPermissionManagement If you'd like more details on this step, please see the Approving Scopes section below.

    Requested API permission Used for
    Presence.Read.All Read presence information of all users in your organization.
    User.Read The Microsoft Graph Toolkit persona card in the people layout.
    People.Read Same as above.
    Contacts.Read Same as above.
    User.Read.All Same as above.
    Files.Read.All Allow search for files using Graph API (Drive / Drive Items).
    Mail.Read Allow search for user's e-mail using Graph API (Messages).
    Calendars.Read Allow search for user's calendar appointments using Graph API (Events).
    Sites.Read.All Allow search for sites using Graph API (Sites / List Items).
    ExternalItem.Read.All Allow search for connector items using Graph API (External Items).
    Bookmark.Read.All Allow search for Bookmarks in Microsoft Search in your organization.
    Acronym.Read.All Allow search for Acronyms in Microsoft Search in your organization.
    Chat.Read Allow search for Teams messages.
    ChannelMessage.Read.All Read user channel messages.
  3. Add the Web Parts to a SharePoint and start building!

"Available Web Parts"

Approving Scopes

You can approve the required scopes in the SharePoint Admin Center on the API Access page. When you visit that page, you will see any pending requests. The screenshot below shows the pending requests for the v4 solution.

"App Catalog"

You'll need to approve each request one at a time. If you have questions about what the requested scopes mean and what permissions they provide, check the article Manage access to Azure AD-secured APIs.

After you approve each request your view will be as shown in the screenshot below.

"App Catalog"

Note about Guest users

By default guest users do not have access to the App Catalog. So if you are not using the CDN option, any SPFx web part from the App Catalog will show an error message for guest users: No Access Error

There are basicly two options to solve this issue, give guest users access to the App Catalog (read) or use the CDN option.

see this for more information.