This reference lists the public API of Storyteller Web SDK 11.0.0. Each entry gives the TypeScript signature, parameters, defaults, errors, and the guide that shows the task. Use the guides to learn a workflow, and use these pages to check an exact name or type.
Your bundler must handle CSS imports. See Install from npm. In a Next.js App Router project, import the stylesheet in the root layout as shown in Use React or Next.js.
The script defines the Storyteller global on window. It differs from the npm package in these ways:
The script adds its styles to the page, so you do not need the npm stylesheet
The script loads its Story player, Clips player, Poll, Quiz, and caption files from the directory that served storyteller.min.js
StorytellerTrackedFunctionalFeature is a type-only export in this build, so Storyteller.StorytellerTrackedFunctionalFeature is undefined. Pass the string values instead, such as 'all' or 'pageReadStatus'
Some parameter and return types are not exported by name, such as the initialize options and the getAdConfig return value. Derive them from an exported signature when you need a name:
The declarations import types from react and react-router-dom. The package lists @types/react (>=17 <20) and @types/react-router-dom (^5.1.7) as peer dependencies.
Signatures come from the published declaration files. A ? marks an optional parameter or field
Since gives the release that added or last changed a member, when the release notes record it
Examples use the namespace import Storyteller. With the CDN script, the same code runs against the Storyteller global
Examples use placeholder values such as demo-api-key and category-id. Replace them with values from your Storyteller tenant
{"slug": "reference-index", "page_title": "Reference Overview", "page_url": "reference/", "canonical_url": "/web/reference/", "markdown": "# API reference\n\nThis reference lists the public API of Storyteller Web SDK 11.0.0. Each entry gives the TypeScript signature, parameters, defaults, errors, and the guide that shows the task. Use the guides to learn a workflow, and use these pages to check an exact name or type.\n\n## Reference pages\n\nThe reference has four pages, organized by the part of the SDK you call:\n\n| Page | Covers |\n| --- | --- |\n| [Storyteller instance](storyteller.md) | `Storyteller.sharedInstance` properties and methods, and `Storyteller.User` |\n| [Views and configuration](views.md) | View constructors, view properties and methods, and the configuration interfaces |\n| [Callbacks](callbacks.md) | `IStorytellerDelegate`, `IListViewDelegate`, and `IStorytellerClipsPlayerDelegate` |\n| [Types and enums](types.md) | Enums, event data, ad request data, theme classes, and server rendering |\n\n## Package entry points\n\nThe SDK ships as an npm package and as a browser script on the Storyteller CDN. Both entry points expose the same singleton, view classes, and enums.\n\n### npm package\n\nInstall the package from npm:\n\n```shell\nnpm install @getstoryteller/storyteller-sdk-javascript\n```\n\nThe package supports these import forms:\n\n=== \"Namespace\"\n\n ```typescript\n import * as Storyteller from '@getstoryteller/storyteller-sdk-javascript';\n ```\n\n=== \"Named\"\n\n ```typescript\n import {\n sharedInstance,\n StorytellerStoriesRowView,\n } from '@getstoryteller/storyteller-sdk-javascript';\n ```\n\n=== \"Default\"\n\n ```typescript\n import Storyteller from '@getstoryteller/storyteller-sdk-javascript';\n ```\n\n=== \"CommonJS\"\n\n ```javascript\n const Storyteller = require('@getstoryteller/storyteller-sdk-javascript');\n ```\n\nThe guides use the namespace import. The import forms return the same objects:\n\n- `Storyteller.sharedInstance` and the named `sharedInstance` export are the same instance\n- The default export is the namespace object. The ESM entry (`index.mjs`) provides it\n- The CommonJS entry (`index.cjs`) returns the namespace object itself, which has no `default` property\n- Importing the package in Node.js does not require `window` or `document`, so server code can import it. Create views only in the browser\n\nThe package `exports` map resolves these paths:\n\n| Import path | Condition | File |\n| --- | --- | --- |\n| `@getstoryteller/storyteller-sdk-javascript` | `types` | `dist/index.npm.d.ts` |\n| `@getstoryteller/storyteller-sdk-javascript` | `import` | `index.mjs` |\n| `@getstoryteller/storyteller-sdk-javascript` | `require`, `default` | `index.cjs` |\n| `@getstoryteller/storyteller-sdk-javascript/dist/storyteller.min.css` | none | `dist/storyteller.min.css` |\n| `@getstoryteller/storyteller-sdk-javascript/package.json` | none | `package.json` |\n\n### Stylesheet\n\nAn npm integration must import the stylesheet once, from code that runs in the browser:\n\n```typescript\nimport '@getstoryteller/storyteller-sdk-javascript/dist/storyteller.min.css';\n```\n\nYour bundler must handle CSS imports. See [Install from npm](../getting-started/npm.md#import-the-sdk-and-styles). In a Next.js App Router project, import the stylesheet in the root layout as shown in [Use React or Next.js](../getting-started/react-nextjs.md#nextjs-app-router).\n\n### CDN script\n\nLoad a fixed SDK version from the Storyteller CDN:\n\n```html\n<script src=\"https://content.usestoryteller.com/javascript-sdk/11.0.0/dist/storyteller.min.js\"><\/script>\n```\n\nThe script defines the `Storyteller` global on `window`. It differs from the npm package in these ways:\n\n- The script adds its styles to the page, so you do not need the npm stylesheet\n- The script loads its Story player, Clips player, Poll, Quiz, and caption files from the directory that served `storyteller.min.js`\n- `StorytellerTrackedFunctionalFeature` is a type-only export in this build, so `Storyteller.StorytellerTrackedFunctionalFeature` is `undefined`. Pass the string values instead, such as `'all'` or `'pageReadStatus'`\n\nSee [Install with a script tag](../getting-started/script.md).\n\n### TypeScript declarations\n\nThe package `types` entry is `dist/index.npm.d.ts`. It re-exports every name from `dist/index.d.ts` and declares the default export.\n\nThese exports are types only. Import them with `import type`, or reference them through the namespace, such as `Storyteller.IListConfiguration`:\n\n- `IListConfiguration`, `IStorytellerClipsPlayerConfiguration`, `IStorytellerEmbeddedClipsPlayerConfiguration`\n- `IStorytellerDelegate`, `IListViewDelegate`, `IStorytellerClipsPlayerDelegate`\n- `StorytellerEventTrackingOptions`\n- `StorytellerAdRequestInfo`, `StorytellerStoriesAdRequestInfo`, `StorytellerClipsAdRequestInfo`\n- `ServerRenderedStory`, `Subset`\n\nSome parameter and return types are not exported by name, such as the `initialize` options and the `getAdConfig` return value. Derive them from an exported signature when you need a name:\n\n```typescript\nimport * as Storyteller from '@getstoryteller/storyteller-sdk-javascript';\n\ntype UserInput = NonNullable<\n Parameters<typeof Storyteller.sharedInstance.initialize>[1]\n>;\n\ntype GetAdConfig = NonNullable<\n Storyteller.IStorytellerDelegate['getAdConfig']\n>;\ntype AdConfig = NonNullable<ReturnType<GetAdConfig>>;\n```\n\nThe declarations import types from `react` and `react-router-dom`. The package lists `@types/react` (`>=17 <20`) and `@types/react-router-dom` (`^5.1.7`) as peer dependencies.\n\n## Exports\n\nThe package exports these names. Names marked as types exist only in TypeScript.\n\n| Export | Kind | Reference |\n| --- | --- | --- |\n| `sharedInstance` | Instance | [Storyteller instance](storyteller.md) |\n| `User` | Instance | [`Storyteller.User`](storyteller.md#storytelleruser) |\n| `StorytellerStoriesRowView` | Class | [Views](views.md#storytellerstoriesrowview) |\n| `StorytellerStoriesGridView` | Class | [Views](views.md#storytellerstoriesgridview) |\n| `StorytellerClipsRowView` | Class | [Views](views.md#storytellerclipsrowview) |\n| `StorytellerClipsGridView` | Class | [Views](views.md#storytellerclipsgridview) |\n| `StorytellerClipsPlayerView` | Class | [Views](views.md#storytellerclipsplayerview) |\n| `StorytellerEmbeddedClipsPlayerView` | Class | [Views](views.md#storytellerembeddedclipsplayerview) |\n| `RowView` | Deprecated alias of `StorytellerStoriesRowView` | [Views](views.md#deprecated-aliases) |\n| `GridView` | Deprecated alias of `StorytellerStoriesGridView` | [Views](views.md#deprecated-aliases) |\n| `IListConfiguration` | Type | [Configuration](views.md#ilistconfiguration) |\n| `IStorytellerClipsPlayerConfiguration` | Type | [Configuration](views.md#clips-player-configuration-types) |\n| `IStorytellerEmbeddedClipsPlayerConfiguration` | Type | [Configuration](views.md#clips-player-configuration-types) |\n| `IStorytellerDelegate` | Type | [Callbacks](callbacks.md#istorytellerdelegate) |\n| `IListViewDelegate` | Type | [Callbacks](callbacks.md#ilistviewdelegate) |\n| `IStorytellerClipsPlayerDelegate` | Type | [Callbacks](callbacks.md#istorytellerclipsplayerdelegate) |\n| `UiStyle` | Enum | [Types](types.md#uistyle) |\n| `CellType` | Enum | [Types](types.md#celltype) |\n| `ActivityType` | Enum | [Types](types.md#activitytype) |\n| `OpenedReason` | Enum | [Types](types.md#openedreason) |\n| `DismissedReason` | Enum | [Types](types.md#dismissedreason) |\n| `StorytellerTrackedFunctionalFeature` | Enum (npm), type (CDN) | [Types](types.md#storytellertrackedfunctionalfeature) |\n| `Alignment`, `ButtonAlignment`, `TextCase` | Enum | [Types](types.md#theme-enums) |\n| `StorytellerEventTrackingOptions` | Type | [Types](types.md#storytellereventtrackingoptions) |\n| `UserActivityData` | Class | [Types](types.md#useractivitydata) |\n| `ActivityEventDetail` | Class | [Types](types.md#activityeventdetail) |\n| `StorytellerAdRequestInfo` | Type | [Types](types.md#storytelleradrequestinfo) |\n| `StorytellerStoriesAdRequestInfo` | Type | [Types](types.md#storytellerstoriesadrequestinfo) |\n| `StorytellerClipsAdRequestInfo` | Type | [Types](types.md#storytellerclipsadrequestinfo) |\n| `UiTheme` | Class | [Types](types.md#uitheme) |\n| `Theme` | Class | [Types](types.md#theme) |\n| `Subset` | Type | [Types](types.md#subset) |\n| `ServerRenderer` | Instance | [Types](types.md#serverrenderer) |\n| `ServerRenderedStory` | Type | [Types](types.md#serverrenderedstory) |\n| `Story` | Class | [Other exports](types.md#other-exports) |\n| `QuizRenderer` | Instance | [Other exports](types.md#other-exports) |\n| `QuizApiService` | Instance | [Other exports](types.md#other-exports) |\n\n## Conventions\n\nThese pages follow these conventions:\n\n- Signatures come from the published declaration files. A `?` marks an optional parameter or field\n- **Since** gives the release that added or last changed a member, when the [release notes](../Changelog.md) record it\n- Examples use the namespace import `Storyteller`. With the CDN script, the same code runs against the `Storyteller` global\n- Examples use placeholder values such as `demo-api-key` and `category-id`. Replace them with values from your Storyteller tenant\n", "copy_markdown_include_header": false, "base_path": "", "ai_dir": "ai", "missing_payload_behavior": "empty"}