@danielgietmann/unsplashfetcher
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

React Unsplash Image Fetcher

Unsplash Image Fetcher is a Node.js package designed for fetching and loading themed, high-resolution images from Unsplash. Ideal for applications needing dynamic, topical visual content.

  • Easy Integration
  • Simple Load Images

Installation

Install with npm

  npm i @danielgietmann/unsplashfetcher

Environment Variables

For this project to work with Unsplash's API, you'll need an API key. It should be specified in the .env file in the root directory as UNSPLASH_CLIENT_ID.

Usage/Examples

  • GetRelevantImage(theme: string) - This function fetches an image that is most relevant to the provided theme using Unsplash's API.
import { GetRelevantImage } from from "@danielgietmann/unsplashfetcher";

GetRelevantImage('nature')
    .then(url => {
        console.log("Image URL: ", url);
    })
    .catch(err => {
        console.error(err);
    });
  • GetLatestImage(theme: string) - This function fetches the latest image for a given theme using Unsplash's API.
import { GetLatestImage } from from "@danielgietmann/unsplashfetcher";

GetRelevantImage('nature')
    .then(url => {
        console.log("Image URL: ", url);
    })
    .catch(err => {
        console.error(err);
    });

Roadmap

  • Create Hook to get Image
  • Add More Options Like Resolution etc.

License

MIT

Package Sidebar

Install

npm i @danielgietmann/unsplashfetcher

Weekly Downloads

3

Version

0.0.1

License

MIT

Unpacked Size

6.4 kB

Total Files

8

Last publish

Collaborators

  • danielgietmann