You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A zero dependency node module for Bring! shopping lists entirely written in TypeScript.
Disclaimer
The developers of this module are in no way endorsed by or affiliated with
Bring! Labs AG, or any associated subsidiaries, logos or trademarks.
Installation
npm install bring-shopping --production
Testing
npm run build
npm test
Smoke test (real Bring account)
BRING_EMAIL="you@example.com" BRING_PASSWORD="secret" npm run smoke
To allow template create/delete during smoke tests:
BRING_SMOKE_ALLOW_WRITE=1 npm run smoke
OpenClaw skill
This repo includes an OpenClaw/ClawHub skill at skills/bring-shopping.
If your OpenClaw setup can load skills from a Git repo, point it at this repository and the skills/bring-shopping folder.
The skill scripts will try to load the updated API from:
BRING_NODE_API_PATH, or
../../node-bring-api/build/bring.js (relative to the skill), or
the installed bring-shopping package.
Usage Example
constbringApi=require(`bring-shopping`);main();asyncfunctionmain(){// provide user and email to loginconstbring=newbringApi({mail: `example@example.com`,password: `secret`});// login to get your uuid and Bearer tokentry{awaitbring.login();console.log(`Successfully logged in as ${bring.name}`);}catch(e){console.error(`Error on Login: ${e.message}`);}// get all lists and their listUuidconstlists=awaitbring.loadLists();// get items of a list by its list uuidconstitems=awaitbring.getItems('9b3ba561-02ad-4744-a737-c43k7e5b93ec');// get translationsconsttranslations=awaitbring.loadTranslations('de-DE');}
constaccount=awaitbring.getUserAccount();console.log(`Logged in as: ${account.email} (${account.userLocale.language})`);
Add a recipe to your shopping list
// Add a recipe with marker and tagged itemsawaitbring.addRecipeToList(listUuid,{name: 'Lasagne',items: [{name: 'Hackfleisch',amount: '500g'},{name: 'Passierte Tomaten',amount: '400ml'},{name: 'Lasagneplatten',amount: '1 Packung'},{name: 'Milch',amount: '200ml'}]});// This adds to your list:// - "=== LASAGNE ===" (marker to identify the recipe)// - "Hackfleisch" with spec "Lasagne - 500g"// - "Passierte Tomaten" with spec "Lasagne - 400ml"// - etc.// If you add another recipe that also needs milk:awaitbring.addRecipeToList(listUuid,{name: 'Pancakes',items: [{name: 'Milch',amount: '300ml'},{name: 'Eier',amount: '3 Stück'}]});// "Milch" now shows: "Lasagne - 200ml, Pancakes - 300ml"// Customize the behavior:awaitbring.addRecipeToList(listUuid,recipe,{addMarker: false,// Don't add "=== RECIPE ===" markertagItems: false,// Don't add recipe name to specmergeExisting: false,// Overwrite existing specs instead of mergingmarkerFormat: '🍝 {name}'// Custom marker format});// Get all recipe markers on a listconstmarkers=awaitbring.getRecipeMarkers(listUuid);// ['LASAGNE', 'PANCAKES']// Remove a recipe markerawaitbring.removeRecipeMarker(listUuid,'Lasagne');
Changelog
2.1.0 (2025-02-01)
Added automatic token refresh with retrieveNewAccessToken() - tokens are refreshed automatically on 401 or expiry
Added getUserAccount() method to get user account information
Added batchUpdateList() for efficient bulk item operations
Added updateItem() and completeItem() convenience methods
Added getListActivity() to retrieve list activity timeline
Added getInspirations() and getInspirationFilters() for recipe features
Added setListArticleLanguage() to configure list language
Added notify() method for sending notifications to list members
Added doesUserExist() to validate email and check if user exists
Added parseRecipe() to parse recipe URLs into template payloads
Added createTemplate() and deleteTemplate() for template/recipe management
Added reloadUserListSettings() and reloadArticleTranslations() for caching
Added mapUserLanguageToLocale() helper for locale mapping
Added new TypeScript interfaces for all new response types
Internal refactoring: centralized request handling with requestJson() and requestText()
2.0.1 (2025-01-21)
(@foxriver76) also throw on http errors
2.0.0 (2024-11-27)
(@foxriver76) ported to native fetch module (BREAKING: Requires Node.js 18 or above)
1.5.1 (2022-10-31)
(foxriver76) updated types
(foxriver76) fixed removeItemImage as headers were missing
1.5.0 (2022-10-31)
(Aliyss) added methods to link an image to an item (PR #221)
1.4.3 (2022-05-01)
(foxriver76) fixed typos in types (thanks to @Squawnchy)
1.4.2 (2021-08-12)
(foxriver76) restructure to typescript
1.3.1 (2021-04-29)
(foxriver76) fixed issue where error was used instead of the mssage on getPendingInvitations
1.3.0 (2020-10-05)
(mdhom) added getItemsDetails method
(foxriver76) now reject with real errors instead of strings
1.2.3 (2019-09-22)
(foxriver76) on new call of login overwrite bearer header to allow reauth
1.2.2
(foxriver76) More information on rejection of getItems
1.2.1
(foxriver76) minor fix
1.2.0
(foxriver76) new functionalities -> getTranslations, getCatalog and getPendingInvitations
1.1.0
(foxriver76) use API version v2
1.0.2
(foxriver76) minor code optimization, nothing functional