koltyakov / pnp-upload

SharePoint: Large files upload example using PnPjs from Node.js
MIT License
13 stars 3 forks source link

Trying out upload without using private.json in config #17

Open astha-yadav opened 1 year ago

astha-yadav commented 1 year ago

I am trying to upload the files using a dynamic site url but since the private.json needs to be updated, the site url kept there becomes static. Any way if i can upload the files to sharepoint without using private.json or will i have to create this json file everytime for each api call?

koltyakov commented 1 year ago

Hi @astha-yadav,

You can store and pass credential whichever way is handy for your application.

When initiating context:

const upload = new Upload(context);

IAuthContext not necessarily should be file based. If creds are provided, no private.json is required.

Also, you can manage it with environment variables.