Learn how to make advanced API requests to Turnkey’s infrastructure.
@turnkey/core
provides a wide 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.
httpClient
provided in the TurnkeyClient
. This client is tied to the active session meaning stamping and organization context are automatically handled for you.
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 httpClient
.
Here’s how you can use the httpClient
to make a signRawPayload
request to Turnkey:
httpClient
, you can view all the metadata of the activity you are performing. This includes the activity ID, votes list, status, and more.
httpClient
will use a securely stored API key to stamp requests to Turnkey. You can switch this to use a passkey or external wallet by passing in a StamperType
to the httpClient
functions. The user will be prompted to sign using the selected method before the request is made.
For example, to use a passkey to stamp the signRawPayload
request, simply pass in StamperType.Passkey
as the second argument: