Overview
The Kotlin SDK provides a variety of helper functions to abstract interactions with Turnkey’s infrastructure. However, you can also make advanced API requests directly to Turnkey’s endpoints if you need more control or want to implement custom features in your Android app.The HTTP client
To make advanced API requests, use theclient from the TurnkeyContext.
You can see the API Reference for a complete list of available API endpoints and their parameters. All of these can be accessed through the client.
Here’s how you can use the client to make a signRawPayload request to Turnkey:
Viewing the activity
When creating, modifying, or using resources within Turnkey, an activity is created. You can learn more about activities in the Activities section. If you use theclient, you can view all the metadata of the activity you are performing. This includes the activity ID, votes list, status, and more.
Using other stampers
A stamper signs your Turnkey requests (think: authenticated request signer). By default theTurnkeyClient uses an API-key stamper that securely signs on device.
You can swap in other stampers—e.g., a passkey stamper—to prompt the user to sign.
Passkey stamper (minimal)
- RP ID must match what you pass into your
TurnkeyConfig/ your WebAuthn config (often your domain, no scheme/port). - The passkey stamper will prompt the user when a request requires a signature.
- Keep the Activity you pass in alive/foreground during the prompt so the system sheet can show.
If your app is primarily passkey-oriented, consider providing a small “client provider” (DI or a singleton) that constructs aTurnkeyClientwith aPasskeyStamperand exposes it via your app container. That keeps Activity references and lifecycle in one place.