Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 814 Bytes

README.md

File metadata and controls

28 lines (22 loc) · 814 Bytes

Turnkey Api Stamper

This package contains functions to stamp a Turnkey request. It is meant to be used with Turnkey's http package.

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>'),
);