New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@arc-core-components/content-source_retail_offer-v1

Package Overview
Dependencies
Maintainers
12
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arc-core-components/content-source_retail_offer-v1

Content source that hooks into the subscriptions retail offers portion of the Arc Suite.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-71.43%
Maintainers
12
Weekly downloads
 
Created
Source

Content Source: Subscriptions Retail API v1 endpoint

This the Arc Core Component representing a content source that hooks into the Subscriptions Retail API portion of the Arc Suite.

The most important part is the pattern, which defines the endpoint that PageBuilder Fusion uses to look up content.

This core component requires that a CDN has already been configured for the site.

Pattern:

https://api-{org}-{website}{-env}.cdn.arcpublishing.com/retail/public/v1/offer/live/{campaign}

Parameters:

This content source takes three parameters: a website URL, the campaign code and the fusion environment.

Getting started

This Core Component must be used within a Fusion project.

  1. Add this schema as a dependency of the repo. npm install @arc-core-components/content-source_retail_offer-v1
  2. Create a file of your desired content source name within the /content/sources folder. For this content source, the suggested name is offers-v1.js
  3. This is the name you should use when referencing this content source in any content config within a custom field.
  4. Paste the following into offers-v1.js:
import { ENVIRONMENT } from 'fusion:environment';
import { createContentSource } from "@arc-core-components/content-source_retail_offer-v1";
export default createContentSource(ENVIRONMENT);

What does this content source return?

This will return subscription and product data for a single campaign.

Overwriting the default website

The default export of the content source is set up for multisite deployments where a _website url parameter is necessary when visiting a specific page. Example: http://localhost/pf/sample-page/?_website=the-gazette. To override this behavior for a single site build we provide a factory function for creating an otherwise unchanged content source with a user provided website.

import { ENVIRONMENT } from 'fusion:environment';
import { createContentSource } from "@arc-core-components/content-source_retail_offer-v1";
export default createContentSource(ENVIRONMENT, "washingtonpost");

Testing & Linting

We are using Jest and XO for testing and linting.

We are using Husky to run a pre-push hook, preventing un-linted or code that fails tests from making it into the repo.

To test: npm test

To lint: npm run lint - This will also fix any simple linter errors automatically.

To push without testing or linting: git push --no-verify - This can often be helpful if you just need to push a branch for demonstration purposes or for help.

FAQs

Package last updated on 16 Dec 2019

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