Astro Loaders by LekoArts

Need to pull in content using Astro's content layer? Reach for one of the provided loaders below and stop dealing with complicated third-party APIs.

Star on Github

Use loaders for

  • Clerk
  • Flickr
  • Plausible

clerkLoader({ clientOptions?: ClerkClientOptions; method: { name: string; options: string | Object } })

Access certain Clerk Backend APIs by choosing a method name.

Example Output

Return values of users.getUserList():

test-05test-04test-03test-02test-01arsaurea

flickrPeopleGetPhotosLoader({ username: string })

Return photos from the given user's photostream. Only photos visible to the calling user will be returned.

Example Output
Woman standing at pedestrian stoplight with old sunlit house in the backgroundAn old building reflecting in a small pond. Between the building and pond there's a lawn area where people hang out.Tropical palm tree house in ViennaAn elevated merry-go-around that goes into the airAt a cafe in Vienna a red table and chair lit by a beam of sun. Empty glasses sit on the table.Long-time exposure of a small river flowing through rocks in the forest

flickrPhotosetsGetListLoader({ username: string })

Returns the photosets belonging to the specified user.

Example Output
Vienna (5)Japan (15)Osaka (7)Kyoto (4)Tokyo (10)Seoul (10)

flickrPhotosetsGetPhotosLoader({ username: string; photoset_id: string })

Get the list of photos in a photoset.

Example Output

Title: Yosemite - Total images: 12

Yosemite ValleyIn the morning the sun heats the cold grass and mist goes upRiver in the foreground, Half Dome (Yosemite) in the backgroundTrees mirroring themselves in a riverWaterfall with rainbow colorsMountain and trees mirroring in river

flickrPhotosetsGetListWithPhotosLoader({ username: string })

This loader combines the flickrPhotosetsGetListLoader() and flickrPhotosetsGetPhotosLoader() loaders to get the most out of photosets. You'll get back the photosets and their list of photos.

Example Output

Title: Tallinn - Total images: 5

Tallinn old townTallinn church towerTallinn churchOverview of Tallinn from viewpointHigh contrast window

Title: Helsinki - Total images: 7

cathedralHelsinki cathedralBoats in harborHelsinki main libraryhelsinki harborFort

plausibleLoader({ query: PlausibleQuery })

Access the Plausible Stats API with your custom query.

Example Output

Return value of a custom query:

{
  "results": [
    {
      "metrics": [
        744
      ],
      "dimensions": []
    }
  ],
  "meta": {}
}