turnkey_http 0.1.1 copy "turnkey_http: ^0.1.1" to clipboard
turnkey_http: ^0.1.1 copied to clipboard

A Dart package for making HTTP requests to the Turnkey API.

turnkey_http #

A lower-level, fully typed HTTP client for interacting with Turnkey API.

Turnkey API documentation lives here: https://docs.turnkey.com.

Example usage:

import 'package:turnkey_api_key_stamper/api_stamper.dart';
import 'package:turnkey_http/turnkey_client.dart';

// This stamper produces signatures using the API key pair passed in.
final stamper = ApiStamper(
  apiPublicKey: '...',
  apiPrivateKey: '...',
);

// The Turnkey client uses the passed in stamper to produce signed requests
// and sends them to Turnkey
final client = TurnkeyClient(
  config: THttpConfig(baseUrl: 'https://api.turnkey.com'),
  stamper: stamper,
);

// Now you can make authenticated requests!
final data = await client.getWhoami(
  input: TGetWhoamiRequest(organizationId: '<Your organization id>'),
);
copied to clipboard

HTTP client #

turnkey_http provides fully typed http client for interacting with the Turnkey API. You can find all available methods here. The types of input parameters and output responses are also exported for convenience.

The OpenAPI spec that generates the client and types is also included in the package.

Generating HTTP Client #

To generate the typed HTTP client from the OpenAPI spec, run the following commands:

  1. Install dependencies:

    flutter pub get
    
    copied to clipboard
  2. Run the code generator

    dart run build_runner build
    
    copied to clipboard
2
likes
130
points
125
downloads

Publisher

verified publisherturnkey.com

Weekly Downloads

2024.09.14 - 2025.03.29

A Dart package for making HTTP requests to the Turnkey API.

Repository (GitHub)

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

build, chopper, collection, flutter, glob, http, json_annotation, path, swagger_dart_code_generator, turnkey_api_key_stamper, turnkey_encoding

More

Packages that depend on turnkey_http