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>'),
);
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:
-
Install dependencies:
flutter pub get
-
Run the code generator
dart run build_runner build
Libraries
- __generated__/services/coordinator/v1/public_api.client
- __generated__/services/coordinator/v1/public_api.enums.swagger
- __generated__/services/coordinator/v1/public_api.swagger
- __generated__/services/coordinator/v1/public_api.types
- base
- builder/builder
- builder/codegen
- builder/constant
- builder/generate
- builder/helper
- builder/types
- config
- turnkey_http
- version