Releases: unsplash/unsplash-js
v7.0.0-beta.1
6.3.0
Changes
- Deprecate
photos.photoDownload
in favor ofphotos.trackDownload
to better clarify method usage.photoDownload
will continue to be supported until version7.0
.
6.2.0
6.2.0
Changes
- Adds support for the languages beta on search
unsplash.search.photos("nature", 1, 10, { lang: "en" });
- Adds support for the new search filters and ordering
unsplash.search.photos("nature", 1, 10, {
orientation: "landscape",
color: "brown", // new
orderBy: "relevant" // new
});
- Adds support for content filtering on search
unsplash.search.photos("nature", 1, 10, { contentFilter: "high" });
- Removes any references to 'popular' ordering (due to deprecation)
6.1.0
Merge pull request #125 from unsplash/maintenance/brotli-compression Add note about node-fetch version to enable brotli compression
6.0.0
Changes
-
To better clarify the use of
accessKey
when initializing,applicationId
has been renamed toaccessKey
:// 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 optionalfilters
object, which currently supportscollections
andorientation
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 |
v4.5.3
Add count
param to photos.getRandomPhoto()
Added a count
property to photos.getRandomPhoto()
, since this property is understood by the API.
Special thanks to @MagicPoulp for his work on this release.
4.5.0
4.4.0
Add per_page
query param to search endpoints.
Updated search.all
, search.photos
, search.users
, and search.collections
to support a per_page
argument. Defaults to 10.
Thanks to @spencerfdavis for his work implementing this feature, and his patience waiting for it to be merged in :)
4.3.0
Add safety check to toJson
In large applications, if you're in the habit of passing promises around, it may be tricky to know whether the response from Unsplash has already been converted to JSON.
This minor update ensures that toJson
is idempotent; that is, it can be invoked using its output as input, returning the same thing when it's invoked multiple times.
4.2.0
- adds universal search endpoints
/search
/search/photos
/search/collections
/search/users