Content pfp
Content
@
https://warpcast.com/~/channel/fc-devs
0 reply
0 recast
0 reaction

vrypan |--o--| pfp
vrypan |--o--|
@vrypan.eth
What is the right way to use SIWF inside a mini app? And also have it work if the user is just viewing the site in their browser?
2 replies
0 recast
2 reactions

Kasra Rahjerdi pfp
Kasra Rahjerdi
@jc4p
at the most bare level: - if you just want it in mini app, all you need to do is verify a signature (fc authkit makes this easy) - if you want it in your .com, it’s the exact same thing but you need to store a session cookie on the mini app you can call sign in every load and it’s implicitly approved, so i do that
1 reply
0 recast
1 reaction

vrypan |--o--| pfp
vrypan |--o--|
@vrypan.eth
I have a website that uses auth-kit, like this: `https://docs.farcaster.xyz/auth-kit/installation`. User can sign in using their farcaster account. Now, I want this website to be used as a mini app. Leaving aside manifest and metadata, etc, when the site is opened as a mini app, on mobile, it shows me a QR code, instead of triggering the SIWF mobile flow.
1 reply
0 recast
1 reaction

vrypan |--o--| pfp
vrypan |--o--|
@vrypan.eth
So my question is probably: How do I properly use authkit inside a mini app?
1 reply
0 recast
1 reaction

Kasra Rahjerdi pfp
Kasra Rahjerdi
@jc4p
you need to call sdk.actions.signIn it will insta return a message and signature you can send to backend to verify
1 reply
0 recast
1 reaction

vrypan |--o--| pfp
vrypan |--o--|
@vrypan.eth
Thanks. So, if I'm in a mini app context, I should not use authkit, but sdk.actions.signIn, right?
1 reply
0 recast
2 reactions

Kasra Rahjerdi pfp
Kasra Rahjerdi
@jc4p
yes BUT use authkit on your backend to do the verification of the signature, just on the front end call the sdk.actions to initiate the sign in
1 reply
0 recast
1 reaction

vrypan |--o--| pfp
vrypan |--o--|
@vrypan.eth
OK, I'm getting there. Is there something special I should keep in mind when setting a session cookie from within a mini app? Looks like everything works, and then the session cookie is ignored. Might be my fault, just checking if there is something I should keep in mind.
1 reply
0 recast
1 reaction

Kasra Rahjerdi pfp
Kasra Rahjerdi
@jc4p
this sounds insane but on the mini app you don’t need any cookie (and can’t access one anyway i think) bc each time you call actions.signin it’ll automatically handle the signin and give you a key to verify if you need
1 reply
0 recast
0 reaction