Farcaster Auth
Using the FDK with Farcaster Auth
The FDK makes it easy to give your Farcaster app write access for users so you can do things like sending casts or following other users. To get a better concept of the flow of Farcaster Auth, check out the guide here.
createSigner
This function will create a signer with Farcaster Auth, sign the key with your Farcaster App mnemonic phrase and FID, then send a request to Warpcast to register the signer. For more info on those please see these docs.
In order to use it make sure the mnemonic and FID are included with the PinataFDK instance.
Example
After creating the signer the user would visit the signerData.deep_link_url
which would open Warpcast on their account to approve the signer. The user will have to pay warps since it is not sponsored.
Response
createSponsoredSigner
Sponsored signers is very similar to createSigner
except the end user will not have to pay warps to approve the signer. However there may be limits to how many sponsored signers you can use based on your Pinata plan. You still need the app_mnemonic
to sign the key being used.
Example
After creating the signer the user would visit the signerData.deep_link_url
which would open Warpcast on their account to approve the signer. Since it is sponsored the user will not have to pay warps to sign in, however it will show Pinata as the app.
Response
pollSigner
After creating a signer and giving the user the deep_link_url
you will want to poll the signer to see if they have approved it and record the response to your account.
Params
pollSigner
takes a parameter of token
which is provided in either createSigner
or createSponsoredSigner
.
Example
Returns
getSigner
After you have created a signer and it has been polled as complete, you can fetch the signer at any time using getSigner
Params
- fid - A number/integer of the FID you want to query. (Optional)