Skip to content

Client for accessing the Storyblok Headless CMS API through Dart.

License

Notifications You must be signed in to change notification settings

jan-pavlovsky/storyblok_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Storyblok Client

Client for accessing the Storyblok Headless CMS API through Dart.

Cache Invalidation

The cache version can either be manually invalidated or automaticity invalided before each request. Control this behavios using the autoCacheInvalidation parameter.

When autoCacheInvalidation is set to false will the cache version not be auto invalidated before each request. To invalidate the cache version manually at appropriate stages in the project, use the invalidateCacheVersion() method.

Retrieve one story

Fetching an example story in the posts folder named one. The returned object is the original Storyblok response body.

import 'package:storyblok_client/storyblok_client.dart';

void main() async {
  const token = '...';
  final storyblok = StoryblokClient(token: token, autoCacheInvalidation: true);

  final data = await storyblok.fetchOne(fullSlug: 'posts/one');
}

Retrieve multiple stories

Fetching multiple stories in the posts folder.

import 'package:storyblok_client/storyblok_client.dart';

void main() async {
  const token = '...';
  final storyblok = StoryblokClient(token: token, autoCacheInvalidation: true);

  final data = await storyblok.fetchMultiple(startsWith: 'posts');
}

Filter

Stories can be filtered by supplying multiple FilterQuery.<filter>() objects to the filterQueries array.

Order

Stories can be ordered by supplying an OrderBy() object to the orderBy parameter.

About

Client for accessing the Storyblok Headless CMS API through Dart.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages