1 | # fcp-client-js
|
2 | Fashion Content Platform - JavaScript SDK
|
3 |
|
4 | ## Getting started
|
5 |
|
6 | ### Install
|
7 |
|
8 | #### with NPM
|
9 |
|
10 | ```
|
11 | npm install --save @fashioninsights-zalando/fcp-client
|
12 | ```
|
13 |
|
14 | #### with Yarn
|
15 |
|
16 | ```
|
17 | yarn add @fashioninsights-zalando/fcp-client
|
18 | ```
|
19 |
|
20 |
|
21 | ### Usage
|
22 |
|
23 | #### Content Insights Client
|
24 |
|
25 | ```
|
26 | import { ContentInsightsApi } from 'fcp-client'
|
27 | ...
|
28 |
|
29 | const client = new ContentInsightsApi({ host: 'http://fcp-host/', tenantID: 'MY_FCP_TENANT_ID' })
|
30 | ...
|
31 | ```
|
32 |
|
33 | #### Influencers Client
|
34 |
|
35 | ```
|
36 | import { InfluencersClient } from 'fcp-client'
|
37 | ...
|
38 |
|
39 | const client = new InfluencersClient({ host: 'http://fcp-host/', tenantID: 'MY_FCP_TENANT_ID' })
|
40 | ...
|
41 | ```
|
42 |
|
43 | ## Development
|
44 |
|
45 | 2. Building
|
46 | * Run `yarn` to get the project's dependencies
|
47 | * Run `yarn run build` to produce minified version.
|
48 | 3. Development mode
|
49 | * 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.
|
50 | 4. Running the tests
|
51 | * Run `yarn run test`
|
52 |
|
53 | ## Scripts
|
54 |
|
55 | * `yarn run build` - produces production version under the `lib` folder
|
56 | * `yarn run dev` - produces development version and runs a watcher
|
57 | * `yarn run test` - well ... it runs the tests :)
|