1.0.0 • Published 7 years ago

ft-next-affinity-client v1.0.0

Weekly downloads
27
License
-
Repository
github
Last release
7 years ago

Next-Affinity-Client

This client provides client-side and server-side interfaces for calling the Affinity API

Usage

Server-side

npm install ft-next-affinity-client

Example call

const affinityApi = require('ft-next-affinity-client');

affinityApi.popular()
	.then(data => {
		// data of most popular items
	});

Articles information should not be called on the server-side on pages that are supposed to cache

Client-side

bower install next-affinity-client

const affinityClient = require('next-affinity-client');

affinityClient.popular({count: 5})
	.then(data => {
		// data for top 5 most popular items
	});

affinityClient.article({id: articleId})
	.then(data => {
		//affinity data for this article
	});

affinityClient.article({id: articleId, uid: userId})
	.then(data => {
		//affinity data for this article, removing user's already read items
	});
1.0.0

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago