0.4.28 • Published 2 years 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
2 years ago
0.4.26
2 years ago
0.4.27
2 years ago
0.4.24
2 years ago
0.4.25
2 years ago
0.4.22
2 years ago
0.4.23
2 years ago
0.4.20
2 years ago
0.4.21
2 years ago
0.4.19
2 years ago
0.4.17
2 years ago
0.4.18
2 years ago
0.4.15
2 years ago
0.4.16
2 years ago
0.4.13
2 years ago
0.4.14
2 years ago
0.4.11
2 years ago
0.4.12
2 years ago
0.4.10
3 years ago
0.4.9
3 years ago
0.4.8
3 years ago
0.4.7
3 years ago
0.4.6
3 years ago
0.4.5
3 years ago
0.4.4
3 years ago
0.4.3
3 years ago
0.4.2
3 years ago
0.4.1
3 years ago
0.4.0
3 years ago
0.3.1
3 years ago
0.3.0
3 years ago
0.2.2
3 years ago
0.2.1
3 years ago
0.2.0
3 years ago