Forum Discussion

Hrvoje Kusulja's avatar
Nov 14, 2018

How to create a new SharePoint add-in for Office Store (so no SPFX) that can use using Graph API

Hello,

I am trying to develop a new SharePoint add-in (SharePoint hosted), that needs to use JavaScript to connect to Microsoft Graph API. Since it is use for Office Store, it should not use SharePoint Framework (SPFX).

 

Any idea how to handle authentication (ADAL/MSAL ?) for graph.microsoft.com from such a SP add-in ? and is it possible at all?

4 Replies

  • Hi Hrvoje,

     

    Are you able to use PnPJs? You can use that outside SPFx

     

    https://github.com/pnp/pnpjs/blob/dev/packages/graph/docs/index.md

     

     

    • Hrvoje Kusulja's avatar
      Hrvoje Kusulja
      MVP

      It seems that following link is just dependent on SharePoint Framework (spfx) which I can not use, since it does not support putting app on SharePoint Store ...

      • Thomas Berman's avatar
        Thomas Berman
        Iron Contributor

        It actually isn't dependent on SPFx but SPFx makes certain operations easier.

         

        You can use PnPJs from a NodeJS app, for example, and authenticate via ADAL to Graph or SharePoint REST APIs.

         

        Not sure if it helps the specifics of your situation, but you can definitely use it outside of SPFx.

         

        https://pnp.github.io/pnpjs/common/docs/adalclient/#manually-configure

Resources