Skip to content

Commit cec5d66

Browse files
committed
Add JavaScript examples
1 parent 19d651a commit cec5d66

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

source/index.html.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ language_tabs:
55
- shell
66
- ruby
77
- python
8+
- javascript
89

910
toc_footers:
1011
- <a href='#'>Sign Up for a Developer Key</a>
@@ -46,6 +47,12 @@ curl "api_endpoint_here"
4647
-H "Authorization: meowmeowmeow"
4748
```
4849

50+
```javascript
51+
const kittn = require('kittn');
52+
53+
let api = kittn.authorize('meowmeowmeow');
54+
```
55+
4956
> Make sure to replace `meowmeowmeow` with your API key.
5057
5158
Kittn uses API keys to allow access to the API. You can register a new Kittn API key at our [developer portal](http://example.com/developers).
@@ -81,6 +88,13 @@ curl "http://example.com/api/kittens"
8188
-H "Authorization: meowmeowmeow"
8289
```
8390

91+
```javascript
92+
const kittn = require('kittn');
93+
94+
let api = kittn.authorize('meowmeowmeow');
95+
let kittens = api.kittens.get();
96+
```
97+
8498
> The above command returns JSON structured like this:
8599
86100
```json
@@ -140,6 +154,13 @@ curl "http://example.com/api/kittens/2"
140154
-H "Authorization: meowmeowmeow"
141155
```
142156

157+
```javascript
158+
const kittn = require('kittn');
159+
160+
let api = kittn.authorize('meowmeowmeow');
161+
let max = api.kittens.get(2);
162+
```
163+
143164
> The above command returns JSON structured like this:
144165
145166
```json

0 commit comments

Comments
 (0)