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
Long-time exposure of a small river flowing through rocks in the forestLook through multiple trees down a valley seeing a streetOld japanese style house surrounded by treesKids playing on the shore of a river and a red bridge spanning over the riverView of the matsumoto castleOverlook over large japanese town with mountains in background

flickrPhotosetsGetListLoader({ username: string })

Returns the photosets belonging to the specified user.

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

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": {}
}