Skip to main content

Flutter

This documentation contains guides for using the Turnkey Flutter / Dart SDK.

We have created a set of Dart packages that can be used to interact with the Turnkey API. These can be combined to create a fully-featured Flutter app, powered by Turnkey.

Packages

Package NameDescriptionLink
turnkey_httpA lower-level, fully typed HTTP client for interacting with the Turnkey API.turnkey_http
turnkey_cryptoThis package consolidates common cryptographic utilities used across our applications, particularly primitives related to keys, encryption, and decryption in a pure Dart implementation.turnkey_crypto
turnkey_api_key_stamperA Dart package for API stamping functionalities. It is meant to be used with Turnkey's HTTP package.turnkey_api_key_stamper
turnkey_encodingThis package contains decoding and encoding functions used by other Turnkey packages.turnkey_encoding
turnkey_flutter_passkey_stamperA Flutter package for stamping payloads with passkeys. It is meant to be used with Turnkey's HTTP package.turnkey_flutter_passkey_stamper
turnkey_sessionsThis package provides developers with an easy way to manage sessions and securely store public-private key pairs on iOS and Android devices.turnkey_sessions

You can visit Turnkey's pub.dev publisher page to see all all the packages we have published and install them in your Flutter project.

Getting Started

The easiest way to build a Flutter app with Turnkey is to use our Flutter demo app as a starter. This app is a fully-featured example that demonstrates how to use the Turnkey's Flutter SDK to authenticate users, create wallets, export wallets, sign messages, and more.

The app includes a backend JavaScript server which uses @turnkey/sdk-server to make requests to Turnkey that must be signed by the parent organization. An example of a request that must be signed by the parent organization is creating a sub-organization. (code reference)

Some requests made to Turnkey must be signed by the sub-organization. These are written in Dart and are ran by the app directly. You can find these requests in the app's TurnkeyProvider. An example of a request that must be signed by the sub-organization is creating a wallet. (code reference)

Video

Complete the installation and setup by following the instructions in the README file.