Home

Authentication

Exporting the embedded signer

Learn how to export the private key

This allows them to use their embedded signer address with another wallet client, such as Metamask in any application. Note that this embedded signer is only controlling the smart account and does not hold assets in it. If you want to simply transfer ownership to a Metamask and interact with a smart contract, we'll recommend checking the transfer ownership section.

To have your user export their embedded signer's private key, use the exportPrivateKey method from the SDK.

If your user is not authenticated or has not yet created an embedded signer in your game, this method will fail.

As an example, you might attach exportPrivateKey as an event handler to an export signer button in your app:

client.ts

_10
await openfort.exportPrivateKey();

info

When your user exports their embedded signer, their private key is assembled on a different origin than your app's origin. This means neither you nor Openfort can ever access your user's private key. Your user is the only party that can ever access their full private key.