Skip to content

6.0.0

Compare
Choose a tag to compare
@lukechesser lukechesser released this 25 Oct 20:58
· 272 commits to master since this release

Changes

  • To better clarify the use of accessKey when initializing, applicationId has been renamed to accessKey:

    // previously
    const unsplash = new Unsplash({
      applicationId: "{APP_ACCESS_KEY}"
    });
    
    // now
    const unsplash = new Unsplash({
      accessKey: "{APP_ACCESS_KEY}"
    });
  • unsplash.photos.getPhotoStats now uses the /photos/:id/statistics endpoint (changelog reference)

  • To support additional filters, the unsplash.search.photos method signature has been changed to support an optional filters object, which currently supports collections and orientation keys.

unsplash.search.photos("nature", 1, 10, { orientation: "landscape", collections: [1,2] })

Removals

6.0 removes deprecated endpoints and parameters to match the changes from the Unsplash API Changelog. Most of these endpoints have been deprecated on the API and removed from unsplash-js documentation for 2+ years.

Removed Method Replacement Reason
unsplash.search.all None This endpoint is undocumented publicly and is highly likely to change in the future. Therefore, we don't recommend anyone use this functionality in their applications.
unsplash.photos.listCuratedPhotos None Curated photos were deprecated in 2017, removed in 2019
unsplash.photos.searchPhotos unsplash.search.photos Replaced by the new search endpoints in 2017
unsplash.photos.uploadPhoto None Removed for legal compatibility
unsplash.collections.listFeaturedCollections unsplash.collections.listCollections Redundant endpoint
unsplash.collections.listCuratedCollections None Curated collections were replaced by collections. Deprecated in 2017, removed in 2019
unsplash.collections.getCuratedCollection unsplash.collections.getCollection Curated collections were replaced by collections. Deprecated in 2017, removed in 2019
unsplash.collections.getCuratedCollectionPhotos unsplash.collections.getCollectionPhotos Curated collections were replaced by collections. Deprecated in 2017, removed in 2019
unsplash.categories.* None Categories were deprecated in 2017 and removed from the API in 2017
Removed Parameter Method Reason
category unsplash.photos.getRandomPhoto Categories were deprecated in 2017 and removed from the API in 2017
w unsplash.photos.getPhoto, unsplash.photos.getRandomPhoto Deprecated in favor of dynamic image URLs
h unsplash.photos.getPhoto, unsplash.photos.getRandomPhoto Deprecated in favor of dynamic image URLs
crop unsplash.photos.getPhoto Deprecated in favor of dynamic image URLs