GitHub for Dart

This is a Client Library for GitHub in Dart.

Features

  • Works on the Server and in the Browser.
  • Fast, really fast.
  • Customizable
  • Fully Tested
  • Supports Authentication

Getting Started

First, add the following to your pubspec.yaml:

dependencies:
  github: ">=0.5.0 <1.0.0"

Then import the library and use it:

For the Server

import 'package:github/client.dart';

void main() {
  var github = new GitHub();
  github.repository(new RepositorySlug("DirectMyFile", "github.dart")).then((Repository repo) {
    /* Do Something */
  });
}

For the Browser

import 'package:github/browser.dart';

void main() {
  /* Required to setup GitHub for the Browser */
  initGitHub();
  
  var github = new GitHub();
  github.repository(new RepositorySlug("DirectMyFile", "github.dart")).then((Repository repo) {
    /* Do Something */
  });
}

Authentication

To use a GitHub token:

var github = new GitHub(auth: new Authentication.withToken("YourTokenHere"));

Links

Contacting Us

You can find us on irc.esper.net at #directcode.

Libraries

github.browser
github.client