Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@homeflow/next

Package Overview
Dependencies
Maintainers
3
Versions
250
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@homeflow/next

## API

  • 0.1.8
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

HomeflowNEXT

API

The API module can only be used server-side. It will throw an error if you try to use it in a client component.

Setup

Instantiate a new instance of the API class in a suitable setup file.

import API from 'homeflownext/api';

const api = new API({
  hestiaURL: process.env.HESTIA_URL,
  hestiaKey: process.env.HESTIA_KEY,
  siteHost: process.env.SITE,
  log: true,
});

export default api;

Site

const site = await api.Site();

Content Chunks

// find a chunk by name
const homeHeroChunk = await api.ContentChunk.find({ name: 'home_hero' });

County

// find a county by url label (slug)
const county = await api.County.find({ urlLabel: 'aberdeenshire' });

Local Development

Tests may not run correctly on older Node versions. Make sure you run nvm use to use the Node version specified in the .nvmrc

Run yarn docs to generate documentation.

Tests

As this package is a combination of client-side and server-side components, Jest is configured to use different environments for each. For this to work, server-side test files must use the extension .node.spec.ts. Client-side tests should use .spec.ts.

Run yarn test to run all tests.

Use yarn test --coverage to generate a coverage report to identify areas of code missing tests.

FAQs

Package last updated on 21 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc