Skip to content

Commit d17e988

Browse files
committed
Updates documentation.
1 parent f0c403d commit d17e988

62 files changed

Lines changed: 22539 additions & 22006 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,38 @@
11
# KKBOX Open API Developer SDK for JavaScript
2+
23
[![npm (scoped)](https://img.shields.io/npm/v/@kkbox/kkbox-js-sdk.svg)](https://www.npmjs.com/package/@kkbox/kkbox-js-sdk)
34
[![Build Status](https://travis-ci.org/KKBOX/OpenAPI-JavaScript.svg?branch=master)](https://travis-ci.org/KKBOX/OpenAPI-JavaScript)
45
[![License Apache](https://img.shields.io/badge/license-Apache-green.svg?style=flat)](https://raw.githubusercontent.com/KKBOX/OpenAPI-ObjectiveC/blob/master/LICENSE)
56

6-
The SDK for accessing various metadata of KKBOX tracks, albums, artists, playlists and stations.
7+
The SDK helps to access various metadata from KKBOX, including tracks, albums, artists, playlists and stations.
8+
9+
### Install Using npm
10+
11+
You can install the SDK using [npm](https://www.npmjs.com) by running
712

8-
### npm install
913
```
1014
npm install @kkbox/kkbox-js-sdk
1115
```
1216

13-
### Source Install
17+
### Install from Source Code
18+
19+
Download the SDK and then input the following command under command line
20+
1421
```
1522
npm install
1623
```
1724

18-
### Build SDK
25+
### Build
26+
1927
```
2028
npm run build
2129
```
2230

2331
### Test
24-
For testing, you should first browse [https://developer.kkbox.com/](https://developer.kkbox.com/) and create an developer account, then create an app to get client id and client secret for that account.
2532

26-
Then, create a file name `client_secrets.json`, put it in the `test` directory and write the client id and client secret in it. The content will be like:
33+
To test or start using the SDK, a valid client ID and client secret are required. Please visit [https://developer.kkbox.com/](https://developer.kkbox.com/), create a new developer account, and obtain the client ID and client secret of your app.
34+
35+
Then, create a file named `client_secrets.json`, put it into the `test` directory, and fill your client ID and client secret into it. It may look like
2736

2837
```
2938
{
@@ -34,16 +43,18 @@ Then, create a file name `client_secrets.json`, put it in the `test` directory a
3443
}
3544
```
3645

37-
And then we can run the tests.
46+
And then we could run the tests by calling
3847

3948
```
4049
npm run test
4150
```
4251

4352
### SDK Documentation
53+
4454
Please browse [https://kkbox.github.io/OpenAPI-JavaScript/](https://kkbox.github.io/OpenAPI-JavaScript/)
4555

4656
## How to use the SDK
57+
4758
There are two classes Auth and Api and you should initialize an Auth object by client id and secret.
4859

4960
```
@@ -96,32 +107,36 @@ import {Api} from '@kkbox/kkbox-js-sdk'
96107
const auth = new Auth(client_id, client_secret)
97108
auth.clientCredentialsFlow.fetchAccessToken().then(response => {
98109
const access_token = response.data.access_token
99-
const api = new Api(access_token)
110+
const api = new Api(access_token)
100111
api.searchFetcher.setSearchCriteria('五月天 派對動物', 'track').fetchSearchResult().then(response => {
101112
console.log(response.data)
102113
api.searchFetcher.fetchNextPage(response).then(response => {
103114
console.log(response.data)
104-
})
115+
})
105116
})
106117
})
107118
```
108-
### Generate the SDK Documentation
119+
120+
### Generate SDK Documentation
121+
109122
npm run build-doc
123+
110124
Then open the the file `docs/index.html`
111125

112126
### [API Documentation](https://docs-en.kkbox.codes/)
113127

114128
### License
129+
115130
Copyright 2017 KKBOX Technologies Limited
116131

117-
Licensed under the Apache License, Version 2.0 (the "License");
118-
you may not use this file except in compliance with the License.
119-
You may obtain a copy of the License at
132+
Licensed under the Apache License, Version 2.0 (the "License");
133+
you may not use this file except in compliance with the License.
134+
You may obtain a copy of the License at
120135

121136
http://www.apache.org/licenses/LICENSE-2.0
122137

123-
Unless required by applicable law or agreed to in writing, software
124-
distributed under the License is distributed on an "AS IS" BASIS,
125-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
126-
See the License for the specific language governing permissions and
127-
limitations under the License.
138+
Unless required by applicable law or agreed to in writing, software
139+
distributed under the License is distributed on an "AS IS" BASIS,
140+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
141+
See the License for the specific language governing permissions and
142+
limitations under the License.

0 commit comments

Comments
 (0)