0.4.28 • Published 10 months ago

northfork-sdk v0.4.28

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

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:

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)

NameDescriptionTypeRequiredDefault Value
usernameUsername used for authorizationstringYes-
stageSpecify if test or prod environment should be used"production" | "development"No"production"

getRecipe Props (returns Promise\<Recipe>)

NameDescriptionTypeRequiredDefault Value
recipeIdRecipeId to search forstringYes-

Data Types

Recipe

NameDescriptionType
idUnique Recipe idstring
titleName of the recipestring
portionsNumber of serves (people to feed). By default 4. Range: 1 - 20.number
cookingTimeCooking time in minutesnumber
imageUrlUrl to a recipe imagestring
ingredientsA list of ingredientsIngredient[]
publishedIf this recipe was published (accessible online)boolean

InitResponse

NameDescriptionType
accessTokenToken used to access API via HTTP Authorization headerstring
refreshTokenToken used to refresh accessTokenstring
typeAuthorization 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