Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

storyblok-js-client

Package Overview
Dependencies
Maintainers
1
Versions
197
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storyblok-js-client - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

dist/index.d.ts

10

dist/index.js

@@ -59,2 +59,12 @@ 'use strict';

}, {
key: 'getStories',
value: function getStories(params) {
return this.get('cdn/stories', params);
}
}, {
key: 'getStory',
value: function getStory(slug, params) {
return this.get('cdn/stories/' + slug, params);
}
}, {
key: 'setToken',

@@ -61,0 +71,0 @@ value: function setToken(token) {

3

package.json
{
"name": "storyblok-js-client",
"version": "1.0.9",
"version": "1.0.10",
"description": "Universal JavaScript SDK for Storyblok's API",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {

@@ -7,0 +8,0 @@ "build": "babel source --presets babel-preset-es2015 --plugins transform-object-assign --out-dir dist"

@@ -50,2 +50,10 @@ 'use strict'

getStories(params) {
return this.get('cdn/stories', params)
}
getStory(slug, params) {
return this.get(`cdn/stories/${slug}`, params)
}
setToken(token) {

@@ -52,0 +60,0 @@ this.accessToken = token

@@ -1,91 +0,9 @@

declare global {
interface StoryblokBridgeConfig {
initOnlyOnce?: boolean,
accessToken: string
}
interface StoryblokBridge {
init: (config: StoryblokBridgeConfig) => void
on: (event: any, callback: () => void) => void
}
interface Window {
storyblok: StoryblokBridge
}
}
import StoryblokClient from './dist/index.js'
import { AxiosInstance } from 'axios'
interface StoryblokConfig {
accessToken: string
cache?: StoryblokCache
timeout?: number
headers?: any
}
interface StoryblokCache {
type?: 'memory'
clear?: 'auto' | 'manual'
}
export interface StoryblokResponse {
data: any
perPage: number
total: number
}
interface Params {
token?: string
with_tag?: string
is_startpage?: 0 | 1
starts_with?: string
by_uuids?: string
excluding_ids?: string
excluding_fields?: string
version?: 'draft' | 'published'
cv?: number
sort_by?: string
search_term?: string
filter_query?: any
per_page?: number
page?: string
}
declare class Storyblok {
throttle: any
cacheVersion: number
accessToken: string
cache: StoryblokCache
client: AxiosInstance
constructor(config: StoryblokConfig, endpoint?: string)
get(slug: string, params?: Params): Promise<StoryblokResponse>
setToken(token: string): void
getToken(): string
cacheResponse(url: string, params: Params): Promise<StoryblokResponse>
newVersion(): number
cacheProvider(): {
get(key: string): any
set(key: string, content: string): void
flush(): void
const client = new StoryblokClient({
accessToken: 'ddd',
cache: {
type: 'memory',
clear: 'auto'
}
flushCache(): this
}
require('./dist/index.d.ts')
let StoryblokClient = require('./dist/index.js')
function greeter(person) {
return "Hello, " + person;
}
let user = "Jane User";
document.body.innerHTML = greeter(user);
const client = new StoryblokClient({
acess: 's'
})
const c = new Storyblok({accessToken: '32423432'})
c.get('ssss').then((res) => {
console.log(res.data.stories)
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc