unsplash / unsplash-js

🤖 Official JavaScript wrapper for the Unsplash API
https://www.npmjs.com/package/unsplash-js
MIT License
2.13k stars 156 forks source link

how to use User_Authentication with unsplash-js? #190

Open zanpen2000 opened 2 years ago

zanpen2000 commented 2 years ago

now I can use unsplash-js like below:

const unsplashApi = createApi({
  accessKey: xxxxxx,
  fetch: nodeFetch,
});

 var result = await unsplashApi.photos.getRandom({
        orientation: 'portrait',
        query: 'tree',
      });

but when i need to upload a photo to my account, i need to use user-authentication, but how?

can anybody give me some code example, PLEASE?

thanks!