Pub Package Build Status Coverage Status Github Issues


A library for authenticating and accessing the Pocket API from Dart

Quick start

import 'package:pocket_client/pocket_client.dart';

const consumerKey = '1234-abcd1234abcd1234abcd1234';
const redirectUrl = 'http://some.redirect.uri/autorizationFinished';

main() async {
  var authentication = new ClientAuthentication(consumerKey);

  var requestToken = await authentication.getRequestToken(redirectUrl);
  var url = ClientAuthentication.getAuthorizeUrl(requestToken, redirectUrl);
  // work whatever redirect magic you need here


  var userData = await authentication.getAccessToken(requestToken);

onAuthorizationFinished(String accessToken) {
  // now you have everything to communicate with Pocket 
Working with Pocket:
import 'package:pocket_client/pocket_client.dart';

const consumerKey = '1234-abcd1234abcd1234abcd1234';
const accessToken = '5678defg-5678-defg-5678-defg56';

main() async {
  var client = new Client(consumerKey, accessToken);

  var options = new RetrieveOptions()
    ..since = new DateTime(2015, 5, 4) = 'Some search query'
    ..domain = 'http://domain.test'
    ..contentType =
    ..detailType = DetailType.complete
    ..isFavorite = true
    ..sortType =
    ..state = State.all
    ..tag = 'cats'
    ..count = 100
    ..offset = 10;

  var response = await client.getData(options: options);
  Map<String, PocketData> items = response.items;
  // do whatever you want with pocket items

  var newItem = new ItemToAdd('')
    ..title = 'FUNNY CAT PICTURES'
    ..tweetId = '123456'
    ..tags = ['cats', 'cool', 'share'];

  PocketData data = await client.addItem(newItem);
  // do whatever you want with received data


See the Api documentation.


The basic example is in example file

Features and bugs

Please fill feature requests and bugs at the issue tracker.


pocket_client is distributed under the BSD license.


The pocket_client library.