{"id":18826,"library":"storyblok-js-client","title":"Storyblok JS Client","description":"Universal JavaScript SDK for Storyblok's Content Delivery and Management APIs. Version 7.3.0 supports Node.js 18+ and modern browsers, with full TypeScript types included. Released as part of the monoblok monorepo, this package is the core client for fetching and manipulating Storyblok content. It provides a thin wrapper around the REST APIs, with built-in caching, rich text rendering, and component resolver support. Key differentiators: isomorphic (works in Node and browser without polyfills), first-class TypeScript support, and seamless integration with Storyblok's visual editor and preview features. Alternatives like @storyblok/js offer framework-agnostic helpers, but this client is the foundational SDK.","status":"active","version":"7.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/storyblok/monoblok","tags":["javascript","storyblok","api","typescript"],"install":[{"cmd":"npm install storyblok-js-client","lang":"bash","label":"npm"},{"cmd":"yarn add storyblok-js-client","lang":"bash","label":"yarn"},{"cmd":"pnpm add storyblok-js-client","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for Node.js environments that lack native fetch (pre-Node 18). Optional if using Node 18+ or modern browsers.","package":"isomorphic-fetch","optional":true}],"imports":[{"note":"Default export is the class. CommonJS require works with default export: const StoryblokClient = require('storyblok-js-client').default.","wrong":"const { StoryblokClient } = require('storyblok-js-client')","symbol":"default (StoryblokClient)","correct":"import StoryblokClient from 'storyblok-js-client'"},{"note":"Named export also available. Both work, but named export is preferred for clarity.","wrong":"import StoryblokClient from 'storyblok-js-client'","symbol":"StoryblokClient (named)","correct":"import { StoryblokClient } from 'storyblok-js-client'"},{"note":"RichTextResolver is a named export, not default. Available since v5.","wrong":"import RichTextResolver from 'storyblok-js-client'","symbol":"RichTextResolver","correct":"import { RichTextResolver } from 'storyblok-js-client'"}],"quickstart":{"code":"import StoryblokClient from 'storyblok-js-client';\n\nconst client = new StoryblokClient({\n  accessToken: process.env.STORYBLOK_ACCESS_TOKEN ?? '',\n  cache: { type: 'memory', clear: 'auto' },\n});\n\nasync function main() {\n  try {\n    const response = await client.getStory('home', { version: 'draft' });\n    console.log('Story:', response.data.story);\n  } catch (error) {\n    console.error('Error:', error);\n  }\n}\n\nmain();","lang":"typescript","description":"Initializes the Storyblok client with an access token and in-memory caching, then fetches a story by slug in draft version."},"warnings":[{"fix":"Upgrade to Node 18+ or install isomorphic-fetch and import it before using the client.","message":"Version 7.0.0 dropped support for Node.js < 18 and removed the built-in polyfill for fetch. Users on older Node versions must provide a fetch polyfill like isomorphic-fetch.","severity":"breaking","affected_versions":">=7.0.0"},{"fix":"Update imports: import { RichTextResolver } from 'storyblok-js-client' instead of requiring it from a separate package.","message":"Version 6.0.0 restructured exports: RichTextResolver moved from a separate package to a named export.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Replace `client.get('cdn/stories/home', ...)` with `client.getStory('home', ...)`.","message":"The method `get` is deprecated in favor of dedicated methods like `getStory`, `getStories`, `getDataSource`, etc.","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Use `const StoryblokClient = require('storyblok-js-client').default;` or switch to ESM imports.","message":"When using CommonJS require(), the default export is nested under `.default`. Many users mistakenly import as `const StoryblokClient = require('storyblok-js-client')` which returns an object with a `default` property.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'18':19 '7.3.0':16 'agnost':100 'altern':94 'api':14,55,111 'around':52 'browser':22,75 'built':58 'built-in':57 'cach':60 'class':80 'client':3,40,104 'compon':65 'content':10,46 'core':39 'deliveri':11 'differenti':69 'editor':90 'featur':93 'fetch':42 'first':79 'first-class':78 'foundat':107 'framework':99 'framework-agnost':98 'full':24 'helper':101 'includ':27 'integr':85 'isomorph':70 'javascript':5,109 'js':2 'key':68 'like':95 'manag':13 'manipul':44 'modern':21 'monoblok':33 'monorepo':34 'node':73 'node.js':18 'offer':97 'packag':36 'part':30 'polyfil':77 'preview':92 'provid':48 'releas':28 'render':63 'resolv':66 'rest':54 'rich':61 'sdk':6,108 'seamless':84 'storyblok':1,8,45,87,110 'storyblok/js':96 'support':17,67,82 'text':62 'thin':50 'type':26 'typescript':25,81,112 'univers':4 'version':15 'visual':89 'without':76 'work':71 'wrapper':51","created_at":"2026-04-25T07:40:19.976047+00:00","updated_at":"2026-04-25T07:40:19.976047+00:00","problems":[{"fix":"Install isomorphic-fetch: npm install isomorphic-fetch, then add `import 'isomorphic-fetch'` at the top of your entry file.","cause":"Node.js version < 18 does not have native fetch, and no polyfill was provided.","error":"TypeError: fetch is not a function"},{"fix":"Run `npm install storyblok-js-client` and ensure your import path is correct.","cause":"Package not installed or missing from node_modules.","error":"Cannot find module 'storyblok-js-client'"},{"fix":"Use `const StoryblokClient = require('storyblok-js-client').default;` instead of `const { StoryblokClient } = require('storyblok-js-client');`.","cause":"Using CommonJS require without accessing the default export.","error":"StoryblokClient is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://www.storyblok.com","github":"https://github.com/storyblok/monoblok","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/storyblok-js-client","openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}