umbraco-client
v1.0.7
Published
JavaScript client for Umbraco using the Content Delivery API.
Downloads
231
Readme
umbraco-client
JavaScript client for Umbraco using the Content Delivery API.
Quickstart
Install the client from npm:
npm install umbraco-client
Import umbraco-client
, and create a new client instance. Below is a simple example in JavaScript.
// umbraco-client.js
import createClient from 'umbraco-client'
export const client = createClient('https://example.com')
Usage
import { client } from './umbraco-client';
const homepage = await client.getContentById('homePage');
const blogPosts = await client.getContentByType('blogPost', {
sort: { type: 'createDate', order: 'asc' }
});
const allContent = await client.getAllContent();