UNPKG

1.49 kBMarkdownView Raw
1# fcp-client-js
2Fashion Content Platform - JavaScript SDK
3
4## Getting started
5
6### Install
7
8#### with NPM
9
10```
11npm install --save @fashioninsights-zalando/fcp-client
12```
13
14#### with Yarn
15
16```
17yarn add @fashioninsights-zalando/fcp-client
18```
19
20
21### Usage
22
23#### Content Insights Client
24
25```
26import { ContentInsightsClient } from '@fashioninsights-zalando/fcp-client'
27...
28
29const client = ContentInsightsClient({ host: 'http://fcp-host/', tenantID: 'MY_FCP_TENANT_ID' })
30...
31```
32
33#### Influencers Client
34
35```
36import { InfluencersClient } from '@fashioninsights-zalando/fcp-client'
37...
38
39const client = InfluencersClient({ host: 'http://fcp-host/', tenantID: 'MY_FCP_TENANT_ID' })
40...
41```
42
43#### Fashion Store Client
44
45```
46import { FashionStoreSearchDataClient } from '@fashioninsights-zalando/fcp-client'
47...
48
49const client = FashionStoreSearchDataClient({ host: 'http://fcp-host/', tenantID: 'MY_FCP_TENANT_ID' })
50...
51```
52
53## Development
54
552. Building
56 * Run `yarn` to get the project's dependencies
57 * Run `yarn run build` to produce minified version.
583. Development mode
59 * Having all the dependencies installed run `yarn run dev`. This command will generate an non-minified version and will run a watcher so you get the compilation on file change.
604. Running the tests
61 * Run `yarn run test`
62
63## Scripts
64
65* `yarn run build` - produces production version under the `lib` folder
66* `yarn run dev` - produces development version and runs a watcher
67* `yarn run test` - well ... it runs the tests :)