0.4.28 • Published 10 months ago
northfork-sdk v0.4.28
Northfork Javascript SDK
SDK for accessing Northfork APIs avaliable for client-side (running in browser) as well as backend (running on node.js)
Code Example
import { initialize, getRecipe } from 'northfork-sdk'
//wait until initialization will finish
await initialize({ username: 'my-username', stage: 'development' })
//get recipe by id
const recipe = await getRecipe('recipe-id')
console.log('Got recipe', recipe.title)
API Reference:
Data Types:
- Recipe
- Ingredient
- InitResponse
initialize Props (returns Promise\<InitResponse>)
Initialized an instance of sdk. No need to save InitResponse
, sdk will save and authorize user by itself after calling initialize
(see code examples above)
Name | Description | Type | Required | Default Value |
---|---|---|---|---|
username | Username used for authorization | string | Yes | - |
stage | Specify if test or prod environment should be used | "production" | "development" | No | "production" |
getRecipe Props (returns Promise\<Recipe>)
Name | Description | Type | Required | Default Value |
---|---|---|---|---|
recipeId | RecipeId to search for | string | Yes | - |
Data Types
Recipe
Name | Description | Type |
---|---|---|
id | Unique Recipe id | string |
title | Name of the recipe | string |
portions | Number of serves (people to feed). By default 4. Range: 1 - 20. | number |
cookingTime | Cooking time in minutes | number |
imageUrl | Url to a recipe image | string |
ingredients | A list of ingredients | Ingredient[] |
published | If this recipe was published (accessible online) | boolean |
InitResponse
Name | Description | Type |
---|---|---|
accessToken | Token used to access API via HTTP Authorization header | string |
refreshToken | Token used to refresh accessToken | string |
type | Authorization type. Usually just 'Bearer' | string |
0.4.28
10 months ago
0.4.26
11 months ago
0.4.27
11 months ago
0.4.24
12 months ago
0.4.25
11 months ago
0.4.22
12 months ago
0.4.23
12 months ago
0.4.20
1 year ago
0.4.21
1 year ago
0.4.19
1 year ago
0.4.17
1 year ago
0.4.18
1 year ago
0.4.15
1 year ago
0.4.16
1 year ago
0.4.13
1 year ago
0.4.14
1 year ago
0.4.11
1 year ago
0.4.12
1 year ago
0.4.10
2 years ago
0.4.9
2 years ago
0.4.8
2 years ago
0.4.7
2 years ago
0.4.6
2 years ago
0.4.5
2 years ago
0.4.4
2 years ago
0.4.3
2 years ago
0.4.2
2 years ago
0.4.1
2 years ago
0.4.0
2 years ago
0.3.1
2 years ago
0.3.0
2 years ago
0.2.2
2 years ago
0.2.1
2 years ago
0.2.0
2 years ago