npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@agility/content-fetch

v2.0.7

Published

JS/TS library for the Agility Fetch API

Downloads

18,394

Readme

Build Status Netlify Status

Agility Content Fetch JS SDK

This is the official JavaScript/TypeScript library for accessing live and preview content from your Agility CMS instance.

You can use this in both node and browser based JS apps.

Don't have an Agility CMS instance? Sign up for Free Trial today!

Features

  • Queries the high-availability, CDN backed Agility Fetch REST API
  • Get a sitemap for a given channel
  • Get a page, including its content zones, modules, and their content
  • Get a content item
  • Query a content list using a filter syntax
  • Get the details of a media gallery
  • Keep track of syncing content to your app

Getting Started

In order to use this sdk, you'll need to install the @agility/content-fetch package and you'll also need to authenticate your requests.

Prerequisites

You must have access to an Agility instance to retrieve the guid and generate your apiKey. Or, you must have these values provided to you.

Installation

npm

npm install @agility/content-fetch

yarn

yarn add @agility/content-fetch

Making a Request

import agility from "@agility/content-fetch"

//initialize the api client
const api = agility.getApi({
	guid: "[guid]",
	apiKey: "[your-api-key]",
})

//make the request: get a content item with the ID 22 in locale 'en-us'
const contentItems = await api.getContentItem({
	contentID: 22,
	locale: "en-us",
})

Documentation

Full documentation for this SDK can be found in our Agility Fetch JS SDK Reference Doc.

For docs & help around Agility CMS, please see Agility CMS Documentation

Tutorials

About the Content Fetch API

Authenticating your Content Fetch API Calls

Retrieving your API Key(s), Guid, and API URL

Making your First Call with the Content Fetch API

Calilng the Content Fetch API using the Javascript SDK

Page Management in a Headless CMS

Using Agility CMS with Create React App

Creating a Module for the Agility CMS Create React App

Creating a Page Template for the Agility CMS Create React App

Deploying your Agility CMS Create React App

Content Webhooks

Contributing

If you would like to contribute to this SDK, you can fork the repository and submit a pull request. We'd love to include your updates.

Running the Tests

An essential part of contributing to this SDK is adding and running unit tests to ensure the stability of the project.

> npm run test